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?
Printable View
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.