SortedDictionary<TKey,TValue>.ValueCollection.ICollection<TValue>.Contains Metod

Definition

Avgör om innehåller ICollection<T> ett angivet värde.

 virtual bool System.Collections.Generic.ICollection<TValue>.Contains(TValue item) = System::Collections::Generic::ICollection<TValue>::Contains;
bool ICollection<TValue>.Contains(TValue item);
abstract member System.Collections.Generic.ICollection<TValue>.Contains : 'Value -> bool
override this.System.Collections.Generic.ICollection<TValue>.Contains : 'Value -> bool
Function Contains (item As TValue) As Boolean Implements ICollection(Of TValue).Contains

Parametrar

item
TValue

Objektet som ska hittas ICollection<T>i .

Returer

trueom item hittas i ICollection<T>; annars . false

Implementeringar

Kommentarer

Implementeringar kan variera i hur de bestämmer objektens likhet. använder Defaulttill exempel List<T> , medan SortedDictionary<TKey,TValue> tillåter användaren att ange vilken implementering som IComparer<T> ska användas för att jämföra nycklar.

Den här metoden är en O()-nåtgärd, där n är Count.

Gäller för