过滤指定的HTML标签

public static string NoHTML(string html)
{
string[] strArray2 = new string[] { "font", "span", "div", "p" };
foreach (string str in strArray2)
{
string pattern = string.Format("</?{0}[^>]*?>", str);
html = Regex.Replace(html, pattern, "", RegexOptions.IgnoreCase);
html = html.Replace("&nbsp;", " ");
}
return html;
}

原文地址:https://www.cnblogs.com/upshania/p/3002530.html