Returns the index of the last occurrence of the string in the current instance.
[Visual Basic] Overloads Public Function LastIndexOf( _ ByVal value As String _ ) As Integer [C#] public int LastIndexOf( string value ); [C++] public: int LastIndexOf( String* value ); [JScript] public function LastIndexOf( value : String ) : int;
Value | Condition |
---|---|
The position | If the string is found. |
The start position | If the string is the empty string. |
-1 | If the string is not found. |
Exception Type | Condition |
---|---|
ArgumentNullException | If the string is null. |
The LastIndexOf method returns the position of the last instance of the specified character array in the string. This string is traversed backwards from right to left. The search is case-sensitive.
The value parameter returns the position from where search commenced if value is the empty string (see Empty).
String Class | String Members | System Namespace | String.LastIndexOf Overload List | Int32