I want the text in a variable (dictated by the text input by the user) to be encoded. For example, every instance of “a” becomes “0”, every instance of “b” becomes “1”, etc.
How do I change specific letters, numbers, and symbols in a variable with multiple different data pieces (i.e. a sentence)?
what happens when you get to 10? do you replace the letters with 2 digit numbers? Seems like you would be better creating an array of numbers and then changing them according to the text in a String
Check out this Regular Expressions behavior. It has an expression that replaces a patten in a string RegEx::Replace(). So to replace every letter “a”, you can use this expression to search for “a” in the string and replace it with “0”. But this only works one time once it finds the first letter “a”. So you need to repeat this for every letter in the string. You can put the actions in a repeat event.
Repeat StrLength(StringVar) times:
change the variable StringVar to: RegEx::Replace(“a”, “”, StringVar, “0”)