Given a list such as this…
string[] fields = new[]
{
"Value1",
"TableStart:Value2",
"Value3",
"Value4",
"TableEnd:Value2",
"Value5",
"Value6"
};
Is there a way I can retrieve all information between the “TableStart” and “TableEnd” statements without writing a loop? I thought Linq might have some way of achieving this but I could not come up with one.
In the example above I would expect a list containing “Value3” and “Value4”.
Maybe:
But i would prefer a simple loop instead.