c# trim method code example
Example 1: c# remove spaces from string
string str = "This is a test";
str = str.Replace(" ", String.Empty);
// Output: Thisisatest
Example 2: c# trim string
string hello = " hello world ";
hello.Trim();
string str = "This is a test";
str = str.Replace(" ", String.Empty);
// Output: Thisisatest
string hello = " hello world ";
hello.Trim();