public string DealHtml(string str)
    {
        //str = Regex.Replace(str, @"\<(img)[^>]*>|<\/(img)>", "", RegexOptions.IgnoreCase);
        str = Regex.Replace(str, @"\<(table|tbody|tr|td|th)[^>]*>|<\/(table|tbody|tr|td|th)>", "", RegexOptions.IgnoreCase);
        str = Regex.Replace(str, @"\<(div|blockquote|fieldset|legend)[^>]*>|<\/(div|blockquote|fieldset|legend)>", "", RegexOptions.IgnoreCase);
        //str = Regex.Replace(str, @"\<(font|i|u|h[1-9]|s)[^>]*>|<\/(font|i|u|h[1-9]|s)>", "", RegexOptions.IgnoreCase);
        //str = Regex.Replace(str, @"\<(style|strong)[^>]*>|<\/(style|strong)>", "", RegexOptions.IgnoreCase);
        //str = Regex.Replace(str, @"\<a[^>]*>|<\/a>", "", RegexOptions.IgnoreCase);
        //str = Regex.Replace(str, @"\<(meta|iframe|frame|span|tbody|layer)[^>]*>|<\/(iframe|frame|meta|span|tbody|layer)>", "", RegexOptions.IgnoreCase);
        str = Regex.Replace(str, @"\<br[^>]*", "", RegexOptions.IgnoreCase);
        str = str.Replace("<br>", "");
        return str;
    }

相关文章:

  • 2021-08-18
  • 2021-06-06
  • 2021-12-23
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
猜你喜欢
  • 2022-12-23
  • 2022-01-23
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案