
public string HtmlFilter(string html)
{
//设置要删除的标记
string[] lable = { "font", "span", "strong", " ", "div", "br" ," "};
foreach (string lb in lable)
{
string reg = String.Format(@"</?{0}[^>]*?>", lb);
//html = Regex.Replace(html, " ", "", RegexOptions.IgnoreCase);
html = Regex.Replace(html, reg, "", RegexOptions.IgnoreCase);
}
return html;
} //lable里填写不需要的标签即可。