Mono Class Library: System.String Overview | Members

System.String.LastIndexOfAny Method

Returns the index of the last occurrence of any element of a specified array of characters in the current instance.

public int LastIndexOfAny (char[] anyOf, int startIndex)

Parameters

anyOf
An array of Unicode characters.
startIndex
A int containing the index of the current instance from which to start searching.

Returns

A int containing the index of the last occurrence of any element of anyOf in the current instance, if found; otherwise, -1.

Exceptions

TypeReason
ArgumentNullExceptionanyOf is a null reference.
ArgumentOutOfRangeExceptionstartIndex is less than zero or greater than or equal to the length of the current instance.

Remarks

This method searches for the last occurrence of the specified characters between the start of the string and the indicated index.

This method is case-sensitive.

Requirements

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