ID:155399
 
How would I remove single quotes or atleast stop single quotes from being in player-typed text strings?
Example:
proc
remove_single_quotes(txt)
while(findtext(txt,"'")) // repeat as long as there are single quotes in the string
txt = copytext(txt,1,findtext(txt,"'")) + copytext(txt,findtext(txt,"'")+1,0) // grabs the text before the single quote and the text after the single quote, excluding the single quote itself, and putting the two pieces of text back together
return txt

mob
verb
talk(msg as text)
world << remove_single_quotes(msg) // remove all single quotes from msg and then sending it to everyone
In response to Nielz
Thanks, I tried using "'" in a findtextex() but it wouldn't work, this probably will.