It is very difficult for me to explain, but I need some help to create a LINQ query (in C#) that will find items with numbers that are following.
Let me explain this with an example. There’s a collection of numbers:
1
5
7
8
11
12
20
I need the combination ‘7’ & ‘8’, and ’11’ & ’12’ because there are following logical. But how can I create a LINQ query that will return this two (or more) combinations, or at least the first number of following row (7 of 11)?
Thanks.
Note this only works for .Net 4 and would return two results if there were a sub-sequence of 7,8,9 for example.