System::Collections::Generic::List::IndexOf method

List::IndexOf(const T&) const method

Gets first index of specific item.

int System::Collections::Generic::List<T>::IndexOf(const T &item) const override
ParameterTypeDescription
itemconst T&Item to look for.

ReturnValue

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

See Also

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
ParameterTypeDescription
itemconst T&Item to look for.
indexintIndex to start lookup at.

ReturnValue

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

See Also