Im trying to replace the # with a $ in the text from the image but for whatever reason it never replaces it when it goes through a different function with a gsub inside of it first.
I have to escape the special characters in order for other characters to get replaced properly but it looks like thats impossible because it would break regular characters if i tried escaping others.
Why does this happen and is there a way to fix this?
This works:
local function esc(x)
return x
end
print(string.gsub("for i,Value in # do\n!\nend",esc("#"), esc("$")))
and this does not:
local function esc(x)
return string.gsub(x,' ', ' ')
end
print(string.gsub("for i,Value in # do\n!\nend",esc("#"), esc("$")))