用正则表达式移除字符串中的HTML标记

  public static string RemoveHTML(string strHtml)
  {
   
string strOutput=strHtml;
   Regex regex 
= new Regex(@"<[^>]+>|</[^>]+>");
   strOutput 
= regex.Replace(strOutput,"");
   
return strOutput;
  }
posted @ 2007-01-04 13:46  Don  阅读(388)  评论(0编辑  收藏  举报