I have a collection of say 8 elements. I want to traverse it in such a way, that after 2 iterations I do something else, and then back to traversing.
A practical application is making a layout. I lay two square boxes, then I print a new line, and then I lay two square boxes.
is there a way I can make a sequence collection into something like this using Linq? Maybe using the Group by clause? Can't think of a solution though.
Collection --> "1, 2, 3, 4, 5, 6, 7, 8"
Want to print like
1 2
3 4
5 6
7 8