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.LastIndexOf (Array, Object, Int32, Int32)

Determines the index of the last occurrence of a value in the one-dimensional Array by searching backwards, starting and ending at the specified indices.

[Visual Basic]
Overloads Public Shared Function LastIndexOf( _
   ByVal array As Array, _
   ByVal value As Object, _
   ByVal startIndex As Integer, _
   ByVal endIndex As Integer _
) As Integer
[C#]
public static int LastIndexOf(
   Array array,
   object value,
   int startIndex,
   int endIndex
);
[C++]
public: static int LastIndexOf(
   Array* array,
   Object* value,
   int startIndex,
   int endIndex
);
[JScript]
public static function LastIndexOf(
   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 backward search.
endIndex
The ending index of the backward search.

Return Value

The index of the last occurrence of value in the range endIndex through startIndex, 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 or endIndex is outside the range of valid indices for array.

-or-

endIndex is greater than startIndex.

Remarks

The Array is searched backwards, starting at startIndex and ending at endIndex, and the elements are compared to the specified value using the Equals method.

See Also

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