I am trying to write a code in C# about getting a text from user (nonword) and finding in this text the consonants one by one and replacing one consonant at a time with another consonant. Then using a text to speech to produce the text.
For example, user writes gokimap. I want to change the constants like this:
do you really want to do what you describe or is your higher goal to find a word which is similar to the input string? In that case you should probably take a look into fuzzy search algorithms. See here: Approximate string matching - Wikipedia
I can find no rhyme nor reason in your description. Finding consonants in a string is trivial, as is replacing them But the example you present doesn’t show any kind of pattern. What are you trying to achieve? What is the replacement pattern? Why did you skip m? why did you replace consonants differently? What are you doing?