I have a string:
string hmtl = " xpto
and need to remove the tags of
Use htmlagilitypack
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml("yourHtml");
foreach(var item in doc.DocumentNode.SelectNodes("//div"))// "//div" is a xpath which means select div nodes that are anywhere in the html
{
item.InnerHtml;//your div content
}
If you want only B tags..
foreach(var item in doc.DocumentNode.SelectNodes("//B"))
{
item.OuterHtml;//your B tag and its content
}