remove all non alphabetic characters from string c#

116

c# filter non alphanumeric characters -

Regex rgx = new Regex("[^a-zA-Z0-9 -]");
str = rgx.Replace(str, "");

remove all non alphabetic characters from string c# -

var cleanString = new string(dirtyString.Where(Char.IsLetter).ToArray());

Comments

Submit
0 Comments