How to remove whitespaces between characters in c#?
Trim() can be used to remove the empty spaces at the beginning of the string as well as at the end.
Trim()
Use String.Replace to replace all white space with nothing.
eg
string newString = myString.Replace(" ", "");