Mono Class Library: System.Collections.Generic.List<T> Overview | Members

System.Collections.Generic.List<T>.Contains Method

Determines whether the list contains a specific value.

public bool Contains (T item)

Parameters

item
The object to locate in the current collection. (item can be null if T is a reference type.)

Returns

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

Remarks

This method uses the default equality comparer for type T to determine equality of list elements. The default equality comparer for element type T is defined in the Description section of this (class List<T>) specification.

This method is an O(n) operation, where n is List<T>.Count.

Requirements

Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0