tags:

views:

53

answers:

1

I have an collection of iQueryable objects. Looking through intellisense i see 'GetElementAt(int)' but what i actually want to do is return multiple elements - so something like GetElementAt(int startindex, int count) GetElementAt(int startindex, int endIndex).

I cant seem to see this. Any ideas?

The only other thing i can think of is to iterate for the number of items i want using GetElementAt() each time e.g.

for (int i = 20;i<40;i++)
   PrintName(MyList.GetElementAt(i));

Which seems to defeat the point abit.

+6  A: 

Sounds like:

myList.Skip(startIndex).Take(count);
Jon Skeet
Looks perfect. Thx!
maxp
Don't you just love LINQ? ;-)
Lucas McCoy