I have a string array, and I need to get a range out of that, say 10 items counting from index 20.
I see there is an extension method called Take that can take a number of items from the beginning of the array, but I also need to specify the starting index.
Use the Skip method first. Like Take, it’s a LINQ extension method and returns an IEnumerable:
If the array contains 20 elements or less, the method does not throw an exception but returns an empty IEnumerable.