首页 > Windows开发 > 详细

C#去除HTML标签

时间:2014-12-22 12:50:32      阅读:275      评论:0      收藏:0      [点我收藏+]
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;
}
转载自:http://www.cnblogs.com/youring2/archive/2013/04/03/2997826.html

C#去除HTML标签

原文:http://www.cnblogs.com/destlive/p/4177761.html

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