Jinsong Liu <Ji*****@mssolution.com.nospam> wrote in
news:4k********************************@4ax.com:
I am in need of same functionality. But is regular expression the only
solution? Is there any other way can do it faster?
I don't know about faster, but you could also:
string s = "1 3 6 0";
while (s.Contains(" ")) s.Replace(" ", " ");
^^ ^^ ^
But of course, that only counts spaces... If you want to get rid of other
whitespace, you'll have to account for that. Really, there's no reason
NOT to use the regular expressions.
-mdb