Gets the last index of the specified character within a string with specified starting and ending search indexes using flags.
[Visual Basic] Overloads Overridable Public Function LastIndexOf( _ ByVal source As String, _ ByVal value As Char, _ ByVal startIndex As Integer, _ ByVal endIndex As Integer, _ ByVal options As CompareOptions _ ) As Integer [C#] public virtual int LastIndexOf( string source, char value, int startIndex, int endIndex, CompareOptions options ); [C++] public: virtual int LastIndexOf( String* source, __wchar_t value, int startIndex, int endIndex, CompareOptions options ); [JScript] public function LastIndexOf( source : String, value : Char, startIndex : int, endIndex : int, options : CompareOptions ) : int;
Value | Meaning |
---|---|
Last index | The last index of the charactervalue in thestring. |
-1 | The specified value is not found. |
startIndex | Thevalue argument is an empty string. |
Exception Type | Condition |
---|---|
ArgumentException | The value argument is null. |
IndexOutOfRangeException | The startIndex or endIndex arguments are[RB28] less than 0 or greater than the length of string. |
The search starts from startIndex and ends at endIndex.
CompareInfo Class | CompareInfo Members | System.Globalization Namespace | CompareInfo.LastIndexOf Overload List