Mono Class Library: System.String Overview | Members

System.String.LastIndexOf Method

Returns the index of the last occurrence of a specified character in the provided range of the current instance.

public int LastIndexOf (char value, int startIndex, int count)

Parameters

value
A Unicode character to locate.
startIndex
A int containing the index of the current instance from which to start searching.
count
A int containing the range of the current instance at which to end searching.

Returns

A int containing the index of the last occurrence of value in the current instance if found between startIndex and (startIndex - count + 1); otherwise, -1.

Exceptions

TypeReason
ArgumentNullExceptionvalue is a null reference.
ArgumentOutOfRangeException

startIndex or count is less than zero.

-or-

startIndex - count is less than -1.

Remarks

This method is case-sensitive.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0