how to remove all spaces and dots in c# code example Example: C# regex replace all spaces with blank LastName = Regex.Replace(LastName, @"\s+", "");