How do you replace a dollar sign in Lua since it is a special character in pattern matching?
I've tried this:
string.gsub("$44,000.00", "$", "")
> "$44,000.00"
But all it does is add a blank at the end of the string. For example
string.gsub("$44,000.00", "$", "what")
> "$44,000.00what"
Knowing $
is a special character is half way to the answer. Use %
to escape magic characters:
string.gsub("$44,000.00", "%$", "what")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With