Say I got next sequence:
1 2 3 4 5 6 7 8 9 10 I need make next thing with Linq:
1,2; 2,3; 3,4; 4,5; ... 9,10; Can't get it.
Say I got next sequence:
1 2 3 4 5 6 7 8 9 10 I need make next thing with Linq:
1,2; 2,3; 3,4; 4,5; ... 9,10; Can't get it.
your_sequence.Take(high - low).Select(i => new []{i, i + 1}) In your case: low = 1, high = 10.
To test you can write
Enumerable.Range(1, 10).Take(10 - 1).Select(i => new []{i, i + 1}) in LinqPad