String..::..LastIndexOf Method (Char, Int32)
Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string.
Namespace:
SystemAssembly: Bridge (in Bridge.dll)
Syntax
[TemplateAttribute] public int LastIndexOf( char ch, int startIndex )
<TemplateAttribute> _ Public Function LastIndexOf ( _ ch As Char, _ startIndex As Integer _ ) As Integer
[TemplateAttribute] public: int^ LastIndexOf( wchar_t^ ch, int^ startIndex )
Parameters
- ch
- Type: System..::..Char
- startIndex
- Type: System..::..Int32
The starting position of the search. The search proceeds from startIndex toward the beginning of this instance.
Return Value
The zero-based index position of value if that character is found, or -1 if it is not found or if the current instance equals Empty.Exceptions
Exception | Condition |
---|---|
System..::..ArgumentOutOfRangeException | The current instance does not equal Empty, and startIndex is less than zero or greater than or equal to the length of this instance. |