Mono Class Library: System.String Overview | Members

System.String.IndexOfAny Method

Returns the index of the first occurrence of any element in a specified array of Unicode characters in the current instance, with the search starting from a specified index.

public int IndexOfAny (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 a positive value equal to the index of the first occurrence of an element of anyOf in the current instance; otherwise, -1 if no element of anyOf was found.

Exceptions

TypeReason
ArgumentNullExceptionanyOf is a null reference.
ArgumentOutOfRangeExceptionstartIndex is greater than the length of the current instance

Remarks

This method is case-sensitive.

Requirements

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