skip over white spaces c# code example Example: remove whitespace between string c# string str = "C Sharp"; str = Regex.Replace(str, @"\s", "");