0
Vote

Write IndexOf and IndexWhere

description

it should behave something like this: 

int firstItem = someItems.Select((item, index) => new
{
ItemName = item,
Position = index
}).Where(i => i.ItemName == "purple elephant")
.First()
.Position;

comments