Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com
Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com
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 on Wednesday, January 16, 2008 10:47 AM ASP.NET | Back to top


Comments on this post: Function to Strip Html Tags

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net