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!

String.LastIndexOf (Char[], Int32, Int32)

Returns the index of the last occurrence of any character in the character array of the current instance.

[Visual Basic]
Overloads Public Function LastIndexOf( _
   ByVal value() As Char, _
   ByVal startIndex As Integer, _
   ByVal endIndex As Integer _
) As Integer
[C#]
public int LastIndexOf(
   char[] value,
   int startIndex,
   int endIndex
);
[C++]
public: int LastIndexOf(
   __wchar_t* value[],
   int startIndex,
   int endIndex
);
[JScript]
public function LastIndexOf(
   value : Char[],
   startIndex : int,
   endIndex : int
) : int;

Parameters

value
A character array containing all of the characters to search for.
startIndex
The index in the current instance where to start searching.
endIndex
The index in the current instance where to stop searching.

Return Value

Value Condition
The index in the string If the character array is found.
-1 If the character array is not found.

Exceptions

Exception Type Condition
ArgumentNullException If the character array is null.
ArgumentOutOfRangeException If either position are less than zero or greater than the length of the string.
ArgumentOutOfRangeException If end position is less than the start position.

Remarks

The LastIndexOf method returns the position of the last instance of the specified character array in the string from a specified starting position to a specified ending position. This string is traversed backwards from right to left, beginning at startIndex and ending at endIndex. The character at position startIndex and the character at position endIndex are included in the search. The search is case-sensitive.

See Also

String Class | String Members | System Namespace | String.LastIndexOf Overload List | Char | Int32 | Array