Here is a line of code to remove all occurrences of   – or any other string for that matter – in a single shot. Ready for this complex feat of engineering?? Ok, here it is:

string theResult = someString.Replace(“ ”,”");

That’s it!