C#提取html文本内容

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

 

转载于:https://www.cnblogs.com/lampon/p/3540725.html

你可能感兴趣的:(C#提取html文本内容)