L
Lee Jackson
Given the following code snippet, which is intended to replace every
instance of double or more spacing with a single space :-
while (sbNormalisedString.ToString().IndexOf(" ") > -1)
sbNormalisedString = sbNormalisedString.Replace(" "," ");
Can anyone tell me why it sometimes goes into an infinate loop?
Ive tried it on both string and stringbuilder instances with the same
issues on both. Also have seen the issue trying to replace instances
of "\n " with "\n".
Im late, its tired, and Ive not idea why...any help appreciated.
Lee
instance of double or more spacing with a single space :-
while (sbNormalisedString.ToString().IndexOf(" ") > -1)
sbNormalisedString = sbNormalisedString.Replace(" "," ");
Can anyone tell me why it sometimes goes into an infinate loop?
Ive tried it on both string and stringbuilder instances with the same
issues on both. Also have seen the issue trying to replace instances
of "\n " with "\n".
Im late, its tired, and Ive not idea why...any help appreciated.
Lee