mrblah mrblah - 5 months ago 27
C# Question

How to loop through a collection that supports IEnumerable?

How to loop through a collection that supports IEnumerable?

Answer

A regular for each will do:

foreach (var item in collection)
{
    // do your stuff   
}