I searched the forums for this, but the code doesnt seem to quite work in the exact way I want
I'm making a script that converts a message to a code (in group convos, only people that have the script will recieve the decoded message). I can replace letters, but only as long as it is an exact match (ie it can't have any characters either side of the one I want to replace).
I'm going to use a multi-dimensional array to store the code like so:
code:
myCode = [["a"]["XyZ"],["A"]["xYz"]];
Thats obviously just an example, but I want to replace ALL "a"s in the message with "XyZ". So I was thinking something like:
code:
tmpMessage = tmpMessage.replace(myCode[0][0],myCode[0][1]);
inside a For Loop.
I know the code seems pointless, but me and my friend usually have group conversations and still talk in a seperate window as well so the other participants don't have a clue what we're talking about.