Monday, November 29, 2010

How to strip non-alphanumeric chars from a string

The example below also leaves the space character and commas intact.

      private string StripSpecialChars(string inputString)
{
return (Regex.Replace(StripHTML(inputString), "[^A-Za-z0-9 ,]", ""));
}

No comments:

Post a Comment