C#中除去所有在HTML元素中标记

 更新时间:2020年6月25日 11:48  点击:1532
/// 除去所有在HTML元素中标记
  public static string StripHTML(string strHtml)
  {
   string strOutput=strHtml;
   Regex regex = new Regex(@"<[^>]+>|</[^>]+>");
   strOutput = regex.Replace(strOutput,"");
   return strOutput;
  }

[!--infotagslink--]

相关文章

  • C#中除去所有在HTML元素中标记

    /// 除去所有在HTML元素中标记 public static string StripHTML(string strHtml) { string strOutput=strHtml; Regex regex = new Regex(@"<[^>]+>|</[^>]+>");...2020-06-25