string str = "C Sharp";
str = Regex.Replace(str, @"s", "");
string str = "C Sharp";
str = Regex.Replace(str, @"s", "");
using System.Linq;
// ...
string example = " Hi there! ";
string trimmed = String.Concat(example.Where(c => !Char.IsWhiteSpace(c)));
// Result: "Hithere!"
string trim = Regex.Replace( text, @"s", "" );
using System.Linq;
...
string source = "abc def
789";
string result = string.Concat(source.Where(c => !char.IsWhiteSpace(c)));
Console.WriteLine(result);