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;
        }
Advertisements