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.