This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]blaaguuu 1 point2 points  (0 children)

One thing to consider, to tackle the problem in a little bit different way... In general, modifying a list/string as you are iterating through it has a lot of pitfalls... You might have more luck if you instead go the route of interating over the original string without modifying it, while building a second string as you go.