IList<T>.GetRange Method

Definition

Creates a shallow copy of a range of elements in the original list.

Delphi
function GetRange(index: Integer; count: Integer): IList<T>

Parameters

index
Integer

The zero-based index at which the range starts.

count
Integer

The number of elements in the range.

Returns

IList<T>

A shallow copy of a range of elements in the original list.

Exceptions

index is less than 0.

-or-

count is less than 0.

-or-

index and count do not denote a valid range of elements in the list.

Remarks

A shallow copy of a collection of reference types, or a subset of that collection, contains only the references to the elements of the collection. The objects themselves are not copied. The references in the new list point to the same objects as the references in the original list. Also if the original list has ownership over its elements.