Trimming a string

How would I trim a string? For example, the script would change:

  • "lol " → “lol”
  • " lol" → “lol”
  • " " → “”
  • " lol " → “lol”
  • etc.
String = String:gsub("%s+", "")

or

String = string.gsub(String "%s+", "")
4 Likes

Thanks a lot! This worked. (character limit)