c# remove non alphanumeric code example Example: c# filter non alphanumeric characters Regex rgx = new Regex("[^a-zA-Z0-9 -]"); str = rgx.Replace(str, "");