Take the 2-minute tour ×

How I can select using Linq only entries from even positions in a list ?

share|improve this question
Even based on what; a row value, even in terms of the list in general, ...? You could .Where(r => r.id % 2 == 0) –  Brad Christie Apr 20 '12 at 17:12

1 Answer 1

up vote 9 down vote accepted

You can use the overload to Enumerable.Where in which the predicate includes the item's index.

var evenIndexes = myList.Where( (num, index) => index % 2 == 0);
share|improve this answer

Your Answer


