首页 > Web开发 > 详细

过滤HTML

时间:2014-07-01 12:50:20      阅读:343      评论:0      收藏:0      [点我收藏+]

过滤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;
}

 

过滤HTML,布布扣,bubuko.com

过滤HTML

原文:http://www.cnblogs.com/upshania/p/3817256.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!