Contains Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Determines whether an element is in the ArrayList.

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

public virtual bool Contains(
	Object item
)

Parameters

item
Type: System..::..Object
The Object to locate in the ArrayList. The value can be nullNothingnullptrunita null reference (Nothing in Visual Basic).

Return Value

Type: System..::..Boolean
true if item is found in the ArrayList; otherwise, false.

Implements

IList..::..Contains(Object)

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

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

Show: