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

Determines whether the ICollection<T> contains a specified value.

Namespace:  System.Collections.Generic
Assemblies:   System.Collections (in System.Collections.dll)
  System (in System.dll)

bool ICollection<TValue>.Contains(
	TValue item
)

Parameters

item
Type: TValue

The object to locate in the ICollection<T>.

Return Value

Type: System.Boolean
true if item is found in the ICollection<T>; otherwise, false.

Implements

ICollection<T>.Contains(T)

Implementations can vary in how they determine equality of objects; for example, List<T> uses Comparer<T>.Default, whereas SortedDictionary<TKey, TValue> allows the user to specify the IComparer<T> implementation to use for comparing keys.

This method is an O(n) operation, where n is Count.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft