IndexOf()

List::IndexOf(const T&) const method

Gets first index of specific item.

int System::Collections::Generic::List<T>::IndexOf(const T &item) const override

Arguments

ParameterTypeDescription
itemconst T&Item to look for.

Return Value

Index of first occurance of specified item or -1 if not found.

List::IndexOf(const T&, int) const method

Looks for specific item in list.

int System::Collections::Generic::List<T>::IndexOf(const T &item, int index) const

Arguments

ParameterTypeDescription
itemconst T&Item to look for.
indexintIndex to start lookup at.

Return Value

Index of first instance of specified item or -1 if not found.

See Also