When using foreach on a collection, after the loop is done should the size of the collection reset? Is there a way to make it so a foreach loop can be done again on that same collection?
When using foreach on a collection, after the loop is done should the size of the collection reset? Is there a way to make it so a foreach loop can be done again on that same collection?
You can do foreach loops as long and as complicated as you want, you just cannot modify the collection in a foreach loop.
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.