Searches the entire one-dimensional Array for a specific value.
[Visual Basic] Overloads Public Shared Function IndexOf( _ ByVal array As Array, _ ByVal value As Object _ ) As Integer [C#] public static int IndexOf( Array array, object value ); [C++] public: static int IndexOf( Array* array, Object* value ); [JScript] public static function IndexOf( array : Array, value : Object ) : int;
The index of the first occurrence of value in the entire one-dimensional array, or-1 if value does not occur in array.
Exception Type | Condition |
---|---|
ArgumentNullException | array is a null reference (in Visual Basic Nothing). |
The Array is searched forwards, and the elements are compared to the specified value using the Equals method.
Array Class | Array Members | System Namespace | Array.IndexOf Overload List | LastIndexOf