I believe this is another easy one for you LINQ masters out there. Is there any way I can separate a List into several separate lists of Some Object, using the item index as the delimiter of each split?
Let me exemplify: I have a List<T>
and I need a List<List<T>>
or List<T>[]
, so that each of these resulting lists will contain a group of 3 items of the original list (sequentially).
example:
Original List: [cat, dog, pane, wolf, pig, sun, queen, fox, x'mas, yak, ice, mark, cold]
Resulting lists: [[cat, dog, pane], [wolf, pig, sun], [queen, fox, x'mas], [yak, ice, mark], [cold]]