首页 > 学院 > 开发设计 > 正文

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

2019-11-18 17:16:24
字体:
来源:转载
供稿:网友

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

  }


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