If you are familiar with Linq
you could use something like this.
int[] array = new int[] { 0, 1, 2, 3, 4, 5, 6,7 };
int index = 0;
int skipCount = 3;
while (index < array.Length)
{
var batch = array.Skip(index).Take(skipCount).ToArray();
if (batch.Length != skipCount) break;
foreach(var n in batch)
{
Console.Write(n);
}
Console.WriteLine();
index += skipCount;
}
On reflection, this solution is over-engineered for the task at hand. It is designed to split an array into batches so that they may be processed asynchronously by different threads.