To remove blank spaces from a string, use:
rettext = rettext.Replace(" ", string.Empty);
Please see:
http://msdn.microsoft.com/en-us/library/fk49wtc1.aspx[
^].
(Always use
string.Empty
instead of "", by a number of reasons.) It should work. If the string is not changes (are you 100% sure?), it simply means that you don't have blank space characters in your input string. Note that many other characters may only look similar to the blank space, but be something else: Em space, En space, Non-breakable space, Tab, and more. I hope you typed " " using blank space, not something else. Look at your input string carefully.
And of course, don't try to use ASCII in .NET, please see my comment to the question. More exactly, you can use it, but only if you can, by some special reasons, guarantee that no input will be beyond ASCII. And learn how Unicode works, it is less trivial than many think.
—SA