mrblah mrblah - 7 months ago 37
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   
}