首页 > Web开发 > 详细

去掉html标签

时间:2015-11-02 21:09:47      阅读:396      评论:0      收藏:0      [点我收藏+]

原地址:http://www.cnblogs.com/youring2/archive/2013/04/03/2997826.html

public static string ReplaceHtmlTag(string html, int length = 0)
{
string strText = System.Text.RegularExpressions.Regex.Replace(html, "<[^>]+>", "");
strText = System.Text.RegularExpressions.Regex.Replace(strText, "&[^;]+;", "");

if (length > 0 && strText.Length > length)
return strText.Substring(0, length);

return strText;
}

去掉html标签

原文:http://www.cnblogs.com/jianghaidong/p/4931072.html

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