Namespace: XPlat.Extensions
Defines a collection of extensions for enumerable objects.
public static class CollectionExtensions
Take(this List, int, int)
Takes a number of elements from the specified list from the specified starting index.
public static IEnumerable<T> Take<T>(this List<T> list, int startingIndex, int takeCount)
list (List)
The list to take items from.
startingIndex (int)
The index to start at in the list.
takeCount (int)
The number of items to take from the starting index of the list.
Returns a collection of T items.
Take(this IReadOnlyList, int, int)
Takes a number of elements from the specified readonly list from the specified starting index.
This example shows how the Take method can be used to take a range of items from a collection.
list (List)
The list to take items from.
startingIndex (int)
The index to start at in the list.
takeCount (int)
The number of items to take from the starting index of the list.
Returns a collection of T items.