I suggest you to use Batch
operator of MoreLINQ (available from NuGet):
IEnumerable<IEnumerable<int>> chuncks = list.Batch(9);
If you want list of lists, then you can create own extension:
public static List<List<T>> Batch(this IEnumerable<T> source, int batchSize)
{
List<List<T>> result = new List<List<T>>();
List<T> batch = new List<T>(batchSize);
foreach(T item in source)
{
if (batch.Count == batchSize)
{
result.Add(batch);
batch = new List<T>(batchSize);
}
batch.Add(item);
}
if (batch.Any())
result.Add(batch);
return result;
}
Your current implementation has big drawback - list.Skip(i)
will enumerate source list from beginning for each batch you are adding to result.