Skip to content Skip to sidebar Skip to footer

Substring Without Breaking Html C#

Hi guys I'm trying to take a description which has been entered in a wysiwyg editor and take a substring of it.. i.e This is some text

Solution 1:

Use the HTML Agility Pack to load the HTML and then get InnerText.

vardocument = newHtmlDocument();
document.LoadHtml("...");
document.DocumentNode.InnerText;

Also see C#: HtmlAgilityPack extract inner text

Post a Comment for "Substring Without Breaking Html C#"