سؤال

I got

var x =  document.DocumentNode.SelectNodes("*//tr[@class='even']")
var y = document.DocumentNode.SelectNodes("*//tr[@class='odd']")  

How can I combine these html node collections?

Edit:

gonna try x.Concat(y).ToList()

هل كانت مفيدة؟

المحلول

Another option is using XPath approach. You can use XPath union (|) to combine two queries :

var xy = document.DocumentNode
                 .SelectNodes("*//tr[@class='even'] | *//tr[@class='odd']");
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top