regex remove any non alphanumeric code example
Example 1: c# filter non alphanumeric characters
Regex rgx = new Regex("[^a-zA-Z0-9 -]");
str = rgx.Replace(str, "");
Example 2: remove all non alphabetic characters from string c#
var cleanString = new string(dirtyString.Where(Char.IsLetter).ToArray());