J
Jim Lawton
Hello group,
I'm not very experienced in C#, but I can't find any example of this (common)
programming problem.
I have a string which contains a repeated substring - lets say it's like :-
the quick ==brown== fox jumps ==over== the lazy ==dog==
I want to replace the first == with ??, so start at index 0, then I want to know
that I have reached position whatever, and I want to replace the next == with
!!, and the next with ?? and so on alternately.
String has an "IndexOf" function, but using that in StringBuilder after each
replace seems very convoluted.
What would be the cleanest C# way to do this?
TIA
Jim
I'm not very experienced in C#, but I can't find any example of this (common)
programming problem.
I have a string which contains a repeated substring - lets say it's like :-
the quick ==brown== fox jumps ==over== the lazy ==dog==
I want to replace the first == with ??, so start at index 0, then I want to know
that I have reached position whatever, and I want to replace the next == with
!!, and the next with ?? and so on alternately.
String has an "IndexOf" function, but using that in StringBuilder after each
replace seems very convoluted.
What would be the cleanest C# way to do this?
TIA
Jim