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

论坛 期权论坛 脚本     
nimin   2020-12-20 06:00   12   0
/// 除去所有在HTML元素中标记
  public static string StripHTML(string strHtml)
  {
   string strOutput=strHtml;
   Regex regex = new Regex(@"<[^>]+>|</[^>]+>");
   strOutput = regex.Replace(strOutput,"");
   return strOutput;
  }

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:1012780
帖子:202556
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP