IList<T>.IndexOf Method

Overloads

IndexOf(T)

Determines the index of a specific item in the list.

IndexOf(T, Integer)

Determines the index of a specific item in the list starting at the specified index.

IndexOf(T, Integer, Integer)

Determines the index of a specific item in the list starting at the specified index and for the specified count of elements.

IndexOf(T)

Determines the index of a specific item in the list.

Delphi
function IndexOf(const item: T): Integer

Parameters

item
T

The element to locate in the list.

Returns

Integer

The index of item if found in the list; otherwise, -1.

IndexOf(T, Integer)

Determines the index of a specific item in the list starting at the specified index.

Delphi
function IndexOf(const item: T; index: Integer): Integer

Parameters

item
T

The element to locate in the list.

index
Integer

The index where to start to locate the specified item in the list.

Returns

Integer

The index of item if found in the list; otherwise, -1.

Exceptions

index is not a valid index in the list.

IndexOf(T, Integer, Integer)

Determines the index of a specific item in the list starting at the specified index and for the specified count of elements.

Delphi
function IndexOf(const item: T; index: Integer; count: Integer): Integer

Parameters

item
T

The element to locate in the list.

index
Integer

The index where to start to locate the specified item in the list.

count
Integer

The number of items to compare item with.

Returns

Integer

The index of item if found in the list; otherwise, -1.