Ok, I have a List<> of objects (which the object contains multiple properties) and I would like to use a LINQ function to transform the List<> to List based on a conditional statement that compares TWO elements at a time. Is this possible?
I tried searching on google but couldn't find it.
Edit: Ok everyone, my apologize I didn't add code. No need to get angry at me :D
Here's some code
var words = apiResult
.Skip(1)
.OrderBy(x => x.BoundingPoly.Vertices[0].Y)
// add here a LINQ statement
.ToList();
apiResult is IReadOnlyList of EntityAnnotation
var apiResult = client.GetText(image);
After I ordered the list according to the Y axis I want to concat words (strings) as a sentence according to the Y axis so that the "words" list will transform into sentences.
For example, if I have three elements in the list such as
{ text: 'Hi', Y: 22 }
{ text: 'There!', Y: 22 }
{ text: 'Bye!', Y: 57 }
it will transform into
{ text: 'Hi There!', Y: 22 }
{ text: 'Bye!', Y: 57 }