Export (0) Print
Expand All

Array.IList.Contains Method

.NET Framework 1.1

Determines whether an element is in the Array.

[Visual Basic]
Private Function Contains( _
   ByVal value As Object _
) As Boolean Implements IList.Contains
[C#]
bool IList.Contains(
   object value
);
[C++]
private: bool IList::Contains(
 Object* value
);
[JScript]
private function IList.Contains(
   value : Object
) : Boolean;

Parameters

value
The object to locate in the Array. The element to locate can be a null reference (Nothing in Visual Basic).

Return Value

true if value is found in the Array; otherwise, false.

Implements

IList.Contains

Exceptions

Exception Type Condition
RankException The current Array is multidimensional.

Remarks

This method performs a linear search; therefore, the average execution time is proportional to ICollection.Count. That is, this method is an O(n) operation, where n is ICollection.Count.

This method determines equality by calling Object.Equals.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Common Language Infrastructure (CLI) Standard

See Also

Array Class | Array Members | System Namespace | IndexOf | LastIndexOf | Performing Culture-Insensitive String Operations in Arrays

Show:
© 2015 Microsoft