Lua String replace
-
28-09-2019 - |
Question
How would i do this?
I got this:
name = "^aH^ai" string.gsub(name, "^a", "")
which should return "Hi", but it grabs the caret character as a pattern character
What would be a work around for this? (must be done in gsub)
Solution
Try:
name = "^aH^ai"
name = name:gsub("%^a", "")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow