Closed GoogleCodeExporter closed 8 years ago
MoreLINQ has Index[1][2] already that solves this problem once and for all. You
can compose it before ForEach like this to get the index:
list.Index().ForEach(e => Console.WriteLine("list[{0}] = {1}", e.Key, e.Value));
[1]
https://code.google.com/p/morelinq/source/browse/MoreLinq/Index.cs?name=1.0&r=9e
a817b7a5aa0983230979259523e663d356e04f
[2] https://www.nuget.org/packages/MoreLinq.Source.MoreEnumerable.Index/
Original comment by azizatif
on 7 May 2015 at 11:54
Original comment by azizatif
on 7 May 2015 at 11:54
Original issue reported on code.google.com by
a...@milyli.com
on 7 May 2015 at 7:05