private string StripSpecialChars(string inputString)
{
return (Regex.Replace(StripHTML(inputString), "[^A-Za-z0-9 ,]", ""));
}
Showing posts with label Strip. Show all posts
Showing posts with label Strip. Show all posts
Monday, November 29, 2010
How to strip non-alphanumeric chars from a string
The example below also leaves the space character and commas intact.
How to strip HTML tags out of a string
static string StripHTML(string inputString)
{
return Regex.Replace
(inputString, "<.*?>", string.Empty);
}
Subscribe to:
Posts (Atom)