Move Next on Multiple Name Iterators
-
01-10-2019 - |
Question
I have two XPathNodeIterator nodeI1 and nodeI2.
I have a loop which should go through each while(nodeI1.MoveNext())
How can I get this loop to automatically start nodeI2.MoveNext() after nodeI1 is done? I don't want to copy paste all the code and make another while loop.
Solution
One straightforward way is to put your loop into a method that takes in a node. Then call it twice.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow