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?

有帮助吗?

解决方案

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:

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top