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;
        }

 

相关文章:

  • 2021-10-20
  • 2021-09-20
  • 2022-12-23
  • 2021-07-17
  • 2022-12-23
猜你喜欢
  • 2021-12-09
  • 2021-06-18
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
相关资源
相似解决方案