2010-06-07 55 views

回答

1

你将不得不内<strong>从字符串中<a>去除串 -

var testString = "<a> contents <strong>strong content</strong> </a>"; 
var doc = new HtmlDocument(); 
doc.LoadHtml(testString); 
var strWithinAnchor = doc.DocumentNode.SelectSingleNode("/a").InnerText; 
var strWithinStrong = doc.DocumentNode.SelectSingleNode("https://stackoverflow.com/a/strong").InnerText; 
var resultString = strWithinAnchor.Replace(strWithinStrong, string.Empty);