substitution

Replacing Multiple Different Occurences with Multiple Different Replacements - Swift4.2

牧云@^-^@ 提交于 2020-12-21 04:03:54
问题 Trying to find the exact format for doing this. I have a textField user input, I want to take that input and find multiple occurrences and replace each unique occurrence with a different unique character respectively. i.e. : replace " example " with " 1328571 " This is my code I currently have (currently is just set up for a single replacement so it doesn't work), formatted in the way that might help to explain what I'm trying to accomplish: let monoText: String = textInput.text! let

Replacing Multiple Different Occurences with Multiple Different Replacements - Swift4.2

三世轮回 提交于 2020-12-21 03:58:12
问题 Trying to find the exact format for doing this. I have a textField user input, I want to take that input and find multiple occurrences and replace each unique occurrence with a different unique character respectively. i.e. : replace " example " with " 1328571 " This is my code I currently have (currently is just set up for a single replacement so it doesn't work), formatted in the way that might help to explain what I'm trying to accomplish: let monoText: String = textInput.text! let