how to remove all special characters from a string in regex code example Example: regex replace all special characters Regex.Replace(your String, @"[^0-9a-zA-Z]+", "")