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
List
SomeObject
Using modular partitioning:
public IEnumerable> Split(IEnumerable input, int chunkSize) { var chunks = (int)Math.Ceiling((double)input.Count() / (double)chunkSize); return Enumerable.Range(0, chunks).Select(id => input.Where(s => s.GetHashCode() % chunks == id)); }