Double Letter Problem
So, I already made a post about a day ago asking for help making all double letters have an "x" in between them. Some nice guy helped me out a lot. The only problem is: I need to make a change to the code he gave me, and don't I know how.
The code he gave me turns every instance of this "hello" into this "helxlo" and "hheelloooo" into "hxhexelxloxoxoxo" which is what I wanted at the time.
Now I only want to change every set of double letters starting with an even number. For example "hello" becomes "helxlo", "abbcc" remains "abbcc" but "abbacc" becomes "abbacxc" because the first letter of the second set of double letters is even (fourth index).
I would really really appreciate the help of a smart person out there to give me a couple minutes of their day and take a look at my code. The code which I am working on is at the bottom, not in the comments.
The solution you came up with seems to work; it's just skipping every other letter. It seems possible that you might run into issues with certain words using this method, depending on where the doubles land. Kudos on finding a solution - Best of luck!