You could use String.Replace method
string str = "C Sharp";
str = str.Replace(" ", "");
or if you want to remove all whitespace characters (space, tabs, line breaks…)
string str = "C Sharp";
str = Regex.Replace(str, @"\s", "");
You could use String.Replace method
string str = "C Sharp";
str = str.Replace(" ", "");
or if you want to remove all whitespace characters (space, tabs, line breaks…)
string str = "C Sharp";
str = Regex.Replace(str, @"\s", "");