首页 > 编程 > C# > 正文

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

2020-01-24 03:50:08
字体:
来源:转载
供稿:网友
/// 除去所有在HTML元素中标记
  public static string StripHTML(string strHtml)
  {
   string strOutput=strHtml;
   Regex regex = new Regex(@"<[^>]+>|</[^>]+>");
   strOutput = regex.Replace(strOutput,"");
   return strOutput;
  }

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表