quote:
Originally posted by Chrissy
The following code will replace all instances of hi with test.
No, It'll replace one instance. For all instances you would have to use a RegExp with the g modifier
js code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
return Message.replace(/hi/gi, "test");
}
g = global
i = case insensitive
Anything between the slashes (/) are the RexExp to look for. Special characters can also be used here to denote certain things.