C#提取html中的汉字

using System.Text.RegularExpressions;      

 private string StripHT(string strHtml)  //从html中提取纯文本
        {
            Regex regex = new Regex("<.+?>", RegexOptions.IgnoreCase);
            string strOutput = regex.Replace(strHtml, "");//替换掉"<"和">"之间的内容
            strOutput = strOutput.Replace("<", "");
            strOutput = strOutput.Replace(">", "");
            strOutput = strOutput.Replace("&nbsp;", "");
            return strOutput;
        }

 

posted @ 2017-11-01 14:30  过一天日子修一天缘  阅读(1524)  评论(1编辑  收藏  举报