标签:
/// <summary> /// 从html中提取纯文本 /// </summary> /// <param name="strHtml"></param> /// <returns></returns> public static string GetHtmlContentText(string strHtml){
if (string.IsNullOrEmpty(strHtml)) return ""; Regex regex = new Regex("<.+?>", RegexOptions.IgnoreCase); string strOutput = regex.Replace(strHtml, "");//替换掉"<"和">"之间的内容strOutput = strOutput.Replace(
"<", "");strOutput = strOutput.Replace(
">", "");strOutput = strOutput.Replace(
" ", ""); return strOutput;}
标签:
原文地址:http://www.cnblogs.com/joeyouyuan/p/5197755.html