I have a string that keeps entire html document. I would like to get all the content inside a div with specific id. For example:
<div id="myId" class = "myClass">
<div class = "myClass">hello</div>
</div>
The clean and correct way would be via an HTML parser, like HtmlAgilityPack:
string stringThatKeepsYourHtml = "<div id=....";
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(stringThatKeepsYourHtml);
string whatUrLookingFor = doc.GetElementbyId("myId").InnerHtml;