how to remove space between string in c# code example Example: how to remove space between string in c# string str = "C Sharp"; str = Regex.Replace(str, @"\s", "");