How to loop through a collection that supports IEnumerable?
or even a very classic old fashion method
IEnumerable collection = new List() { "a", "b", "c" }; for(int i = 0; i < collection.Count(); i++) { string str1 = collection.ElementAt(i); // do your stuff }
maybe you would like this method also :-)