how to remove space between string in c#

C#
string str = "C Sharp";
str = Regex.Replace(str, @"\s", "");
Source

Also in C#: