过滤字符串中的html标签

    #region 过滤html标签
    
/// <summary>
    
/// 过滤html标签
    
/// </summary>
    
/// <param name="contents">要过滤的字符串</param>
    
/// <returns></returns>
    public static string RemoveHtml(string contents)
    {
        
string strTmp = null;
        strTmp 
= Regex.Replace(contents, "<(.[^>]*)>""");
        
return strTmp;

    }
    
#endregion

posted on 2009-05-13 17:25  郑州--飞猫  阅读(267)  评论(0编辑  收藏  举报

导航