C#提取html文本内容

    public string Tohtml(string zifu)
        {
            string noStyle = zifu.Replace("&quot;", "\"").Replace("&lt;", "<").Replace("&gt;", ">").Replace("&quot;", "\"").Replace("&nbsp;", "");
            noStyle = Regex.Replace(noStyle, @"<[\w\W]*?>", "",
           RegexOptions.IgnoreCase);
            noStyle = Regex.Replace(noStyle, @"\s", "",
          RegexOptions.IgnoreCase);
            return noStyle;
        }

 

posted @ 2014-02-08 16:46  lampon  阅读(2414)  评论(0编辑  收藏  举报