Question

I am retrieving values from my array using arr.GetValue(5, 6, 7, 8), arr.GetValue(10, 11, 12, 13) many times.

Is there a shorthand for this like arr.Get(offset, count) so that I can use arr.Get(5, 4), arr.Get(10, 4) to get the smaller array from the bigger array?

Was it helpful?

Solution

Use Skip and Take to jump around an enumerated list:

var slice = arr.Skip(5).Take(4);

You may find some different answers and more info at these questions:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top