c# index in select

C#
collection.Select((v, i) => new {value = v, index = i});
Source

Also in C#: