This is probably a better answer:public static void RemoveComments(HtmlNode node){ foreach (var n in node.ChildNodes.ToArray()) RemoveComments(n); if (node.NodeType == HtmlNodeType.Comment) node.Remove();} 这篇关于从InnerText删除注释行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-25 18:04