DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="5.8.0" />

 ListSegment<T>

Delimits a section of a list.
public int Count { get; }

Gets the number of elements in the segment.

public T this[int index] { get; set; }

Gets or sets element at the specified index.

public ListSegment(IList<T> list, Range range)

Initializes a new segment of the list.

public bool Contains(T item)

Determines whether this section contains a specified value.

public void CopyTo(T[] array, int arrayIndex)

Copies the elements in this section to an array.

Gets enumerator of elements in this section.

public int IndexOf(T item)

Determines the index of a specific item.

public bool TryGetSpan(out Span span)

Attempts to get span over elements in this segment.