RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
To replace all occurrences of one letter, you must use regular expressions. They come in a form of /pattern/switch , and you must use the g switch for global search (for more information on regular expression, google it)
so, the correct code for replacing all occurrences of "a" is:
sMessage = sMessage.replace(/a/g,"A");
(notice you don't use " " in a regular expression)
|