use trim to delete spaces in c# winform code example
Example: c# remove spaces from string
string str = "This is a test";
str = str.Replace(" ", String.Empty);
// Output: Thisisatest
string str = "This is a test";
str = str.Replace(" ", String.Empty);
// Output: Thisisatest