Function to Strip Html Tags

I have a string that include HTML tags <B> font etc. I want to Strip Html Tags to show the string as tooltip.
Thanks to HtmlAgilityPack it is easy:

      public static string StripHtmlTags(string html)
        {
            if(String.IsNullOrEmpty(html)) return "";
            HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
            doc.LoadHtml(html);
            return doc.DocumentNode.InnerText;
        }

posted @ Wednesday, January 16, 2008 10:47 AM

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
 
 
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345