NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Array.IndexOf (Array, Object, Int32, Int32)

Searches the one-dimensional Array for a specific value, starting at the specified start index and ending at the element just prior to the specified end index (?).

[Visual Basic]
Overloads Public Shared Function IndexOf( _
   ByVal array As Array, _
   ByVal value As Object, _
   ByVal startIndex As Integer, _
   ByVal endIndex As Integer _
) As Integer
[C#]
public static int IndexOf(
   Array array,
   object value,
   int startIndex,
   int endIndex
);
[C++]
public: static int IndexOf(
   Array* array,
   Object* value,
   int startIndex,
   int endIndex
);
[JScript]
public static function IndexOf(
   array : Array,
   value : Object,
   startIndex : int,
   endIndex : int
) : int;

Parameters

array
The one-dimensional Array to search.
value
The Object to locate in array.
startIndex
The starting index of the search.
endIndex
The index after (?) the last element of the search range.

Return Value

The index of the first occurrence of value in the range startIndex through endIndex-1 (?), or-1 if value does not occur in that range.

Exceptions

Exception Type Condition
ArgumentNullException array is a null reference (in Visual Basic Nothing).
ArgumentOutOfRangeException startIndex is outside the range of valid indices for array.

-or-

endIndex is less than startIndex.

-or-

endIndex is greater than the last valid index of array plus 1 (?).

Remarks

The Array is searched forwards, starting at startIndex and ending at the element just prior to (?) endIndex, and the elements are compared to the specified value using the Equals method.

See Also

Array Class | Array Members | System Namespace | Array.IndexOf Overload List | LastIndexOf