Is there any way I can separate a List into several separate lists of SomeObject, using the item index as the delimiter of each s
Here's a list splitting routine I wrote a couple months ago:
public static List> Chunk(
List theList,
int chunkSize
)
{
List> result = theList
.Select((x, i) => new {
data = x,
indexgroup = i / chunkSize
})
.GroupBy(x => x.indexgroup, x => x.data)
.Select(g => new List(g))
.ToList();
return result;
}