Click or drag to resize
StringLastIndexOf 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.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public int LastIndexOf(
	char value,
	int startIndex
)

Parameters

value
Type: SystemChar
The Unicode character to seek.
startIndex
Type: SystemInt32
The starting position of the search. The search proceeds from startIndex toward the beginning of this instance.

Return Value

Type: Int32
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
ExceptionCondition
ArgumentOutOfRangeExceptionThe current instance does not equal Empty and startIndex is less than zero, or greater than or equal to the length of this instance.
See Also