Adding a index for items in a linq query

It is possible to add a index to a linq query as follows:

var list = new List<string> { "Zero", "One", "Two", "Three", "Four", "Five" };
var indexed = list.Select((l, i) => new { Item = l, Index = i });

Comments are closed.