System::Collections::Generic::List::LastIndexOf method

List::LastIndexOf(const T&) const method

Searches for the specified object and returns the zero-based index of the last occurrence within the entire list.

int32_t System::Collections::Generic::List<T>::LastIndexOf(const T &item) const
ParameterTypeDescription
itemconst T&The object to locate in the list

ReturnValue

The zero-based index of the last occurrence of item within the entire the List, if found; otherwise, -1.

See Also

List::LastIndexOf(const T&, int32_t) const method

Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the List that extends from the first element to the specified index.

int32_t System::Collections::Generic::List<T>::LastIndexOf(const T &item, int32_t index) const
ParameterTypeDescription
itemconst T&The object to locate in the list
indexint32_tThe zero-based starting index of the backward search.

ReturnValue

The zero-based index of the last occurrence of item within the range of elements in the List that extends from the first element to index, if found; otherwise, -1.

See Also

List::LastIndexOf(const T&, int32_t, int32_t) const method

Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the List that contains the specified number of elements and ends at the specified index.

int32_t System::Collections::Generic::List<T>::LastIndexOf(const T &item, int32_t index, int32_t count) const
ParameterTypeDescription
itemconst T&The object to locate in the List
indexint32_tThe zero-based starting index of the backward search.
countint32_tThe number of elements in the section to search.

ReturnValue

The zero-based index of the last occurrence of item within the range of elements in the List that contains count number of elements and ends at index, if found; otherwise, -1.

See Also