List<T>.IList.Contains(Object) Methode

Definition

Bestimmt, ob der IList Wert einen bestimmten Wert enthält.

 virtual bool System.Collections.IList.Contains(System::Object ^ item) = System::Collections::IList::Contains;
bool IList.Contains(object item);
abstract member System.Collections.IList.Contains : obj -> bool
override this.System.Collections.IList.Contains : obj -> bool
Function Contains (item As Object) As Boolean Implements IList.Contains

Parameter

item
Object

Der Object zu findende In der IList.

Gibt zurück

true if item is found in the IList; otherwise, false.

Implementiert

Hinweise

Diese Methode bestimmt die Gleichheit mithilfe des Standardgleichgleichsvergleichs EqualityComparer<T>.Default für T, den Typ der Werte in der Liste.

Diese Methode führt eine lineare Suche durch; Daher ist diese Methode ein O(n)-Vorgang, wobei n ist Count.

Gilt für: