views:

33

answers:

1

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.

+3  A: 

One straightforward way is to put your loop into a method that takes in a node. Then call it twice.

Conrad Frix
I agree, you could extract your loop into a seperate method and call it twice. +1
Lily