IList<T>.LastIndexOf Method

Overloads

LastIndexOf(T)

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

LastIndexOf(T, Integer)

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

LastIndexOf(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 towards the start of the list.

LastIndexOf(T)

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

Delphi
function LastIndexOf(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.

LastIndexOf(T, Integer)

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

Delphi
function LastIndexOf(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.

LastIndexOf(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 towards the start of the list.

Delphi
function LastIndexOf(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.