I have the following expression to strip HTML tags away from data retrieved. How may i edit it to filter out special characters as well? (eg. , @amp; etc)
Currently it only filters out <>.
@ Page.xaml.cs:
//remove HTML from string with Regex.
public static string StripTagsRegex(string source)
{
return Regex.Replace(source, "<.*?>", string.Empty);
}
Don’t. Use HTML parser, and once you fed HTML into it, then get InnerText (not html) of it. This way you get only content of the html.