c# string remove whitespces code example
Example 1: remove whitespace between string c#
string str = "C Sharp";
str = Regex.Replace(str, @"\s", "");
Example 2: c# remove all whitespaces from string
string trim = Regex.Replace( text, @"s", "" );
string str = "C Sharp";
str = Regex.Replace(str, @"\s", "");
string trim = Regex.Replace( text, @"s", "" );