Quite often I found myself in a situation of needing to know what index an item is in a List while enumerating through the list. Is there any way to do this with out having to resort to using a for(var i=0...) loop?
Ideally I would like to do something like this. e.g
foreach(SomeType item in myList){
Console.Write(item.Index);
}
jQuery has this $(this).index(); which is something like what I would like in C#