Strip HTML using HtmlAgilityPack

Strip HTML using HtmlAgilityPack

public static string StripHtml(this string value)
{
	HtmlDocument htmlDoc = new HtmlDocument();
	htmlDoc.LoadHtml(value);

	if (htmlDoc == null)
		return value;

	return htmlDoc.DocumentNode.InnerText;
}

 

Source: Strip HTML using HtmlAgilityPack

Leave a Reply

Your email address will not be published. Required fields are marked *