ID:156041
 
Hello Byond Programmers. I have a question that will hopefully be easy to answer.
I'd like to implement a text censor for cuss words in a text MUD i'm coding. I understand the find text concept
    verb
say(msg as text)
usr << "You say, '[msg]'"
oview() << "[usr] says, '[msg]'"
if (findtext(msg, "fart"))
usr << "Hahaha you said fart."


But how do I get this to take the msg and censor out the word with *****
Read this lib, it should give you a good idea on how to use copytext() and findtext for what you're trying to do.
In response to AntioneKenero
Or fetch Deadron's TextHandling library and make use of the dd_replacetext() and dd_replaceText() procs.
I made myself a nice little censor that works about 99%...I was thinking about releasing it in the PopLava Resource Center...maybe this is some reason that I should.