Also if possible I need to be able to add more things for it to remove like a table:
toRemove = {"\","#"} Please help thanks
Scripts
Check if a string contains \
Check if a string contains \
1

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, "@"))
Hajt did for every character in the table, because string.gsub accepts a regex pattern.
string.gsub(text, pattern, replace-with[, n])
VADemon has written
1
