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. [Edit]

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

Parameters

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

Returns

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

Exceptions

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

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.

[Edit]

Requirements

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