-
-
Save starquake/8d72f1e55c0176d8240ed336f92116e3 to your computer and use it in GitHub Desktop.
Strip HTML using HtmlAgilityPack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string StripHtml(this string value) | |
{ | |
HtmlDocument htmlDoc = new HtmlDocument(); | |
htmlDoc.LoadHtml(value); | |
if (htmlDoc == null) | |
return value; | |
return htmlDoc.DocumentNode.InnerText; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment