Also if possible I need to be able to add more things for it to remove like a table:
toRemove = {"\","#"}
Please help thanks
toRemove = {"\","#"}
toRemove = {"\\","#"}
example = "\#hi friends"
example_fixed = fixString(example)
toRemove = {"\","#"}
example_fixed = "hi friends"
toRemove = {"\\","#"} function escape_string(text) 	for i = 1, #toRemove do 		text = string.gsub(text, toRemove[i], "") 	end 	return text end print(escape_string("\#hi friends"))
print(string.format("%q", "\\#"))
badchars = "Aabc\\#,%" -- case-sensitive badchars = "[".. badchars:gsub("[%(%)%.%%%+%-%*%?%[%^%$%]]", "%%%1") .."]" -- escape Lua regex and make it a pattern print(string.gsub("Awful string by hacker omg\\thats#illeg'al!", badchars, "@"))
string.gsub(text, pattern, replace-with[, n])