C#去除HTML標簽。本站提示廣大學習愛好者:(C#去除HTML標簽)文章只能為提供參考,不一定能成為您想要的結果。以下是C#去除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;
}
轉載自:http://www.cnblogs.com/youring2/archive/2013/04/03/2997826.html
參考頁面:http://qingqingquege.cnblogs.com/p/5933752.html