Array.IList.Contains Method

July 28, 2014

Determines whether an element is in the Array.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

bool IList.Contains(
	Object value
)

Parameters

value
Type: System.Object
The object to locate in the Array. The element to locate can be null for reference types.

Return Value

Type: System.Boolean
true if value is found in the Array; otherwise, false.

Implements

IList.Contains(Object)

ExceptionCondition
RankException

The current Array is multidimensional.

This method performs a linear search; therefore, this method is an O(n) operation, where n is ICollection.Count.

This method determines equality by calling the Object.Equals method.

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

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft