Answered by
5 years ago Edited 5 years ago
Hey Shaddy, what you're finding here is lua recognizing that as a magic character.
() are part of the magic characters and have special meaning when used in a pattern, more information can be found here.
In order for you to just get the ( part of the string you want to use % which allows you to escape it from being recognized as a pattern, and just taken as a simple string.
Example:
1 | local var = "(I do not enjoy pineapple pizza.)" |
2 | var = string.gsub(var, "%(" , "" ) |
3 | var = string.gsub(var, "%)" , "" ) |