List<T>.IList.IndexOf(Object) Metodo
Definizione
virtual int System.Collections.IList.IndexOf(System::Object ^ item) = System::Collections::IList::IndexOf;
int IList.IndexOf (object item);
Function IndexOf (item As Object) As Integer Implements IList.IndexOf
Parametri
Restituisce
Indice di item
, se presente nell'elenco; in caso contrario, -1.The index of item
if found in the list; otherwise, -1.
Implementazioni
Eccezioni
Il tipo di item
non può essere assegnato a IList.item
is of a type that is not assignable to the IList.
Commenti
Questo metodo determina l'uguaglianza utilizzando l'operatore di confronto di uguaglianza predefinito EqualityComparer<T>.Default per T
, il tipo di valori nell'elenco.This method determines equality using the default equality comparer EqualityComparer<T>.Default for T
, the type of values in the list.
Questo metodo esegue una ricerca lineare; Pertanto, questo metodo è un'operazione O (n), dove n è Count.This method performs a linear search; therefore, this method is an O(n) operation, where n is Count.