mrblah mrblah - 1 year ago 61
C# Question

How to loop through a collection that supports IEnumerable?

How to loop through a collection that supports IEnumerable?

Answer Source

A regular for each will do:

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