Mono Class Library: System.String Overview | Members

System.String.IndexOf Method

Returns the index of the first occurrence of a specified Unicode character in the current instance, with the search over the specified range starting at the provided index. [Edit]

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

Parameters

value
A Unicode character. [Edit]
startIndex
A int containing the index of the current instance from which to start searching. [Edit]
count
A int containing the number of consecutive elements of the current instance to be searched starting at startIndex. [Edit]

Returns

A int containing the zero-based index of the first occurrence of value in the current instance in the specified range of indexes; otherwise, -1 if value was not found. [Edit]

Exceptions

TypeReason
ArgumentOutOfRangeException

startIndex or count is negative

-or-

startIndex + count is greater than the length of the current instance.

[Edit]

Remarks

The search begins at startIndex and continues until startIndex + count - 1 is reached. The character at startIndex + count is not included in the search.

This method is case-sensitive.

[Edit]

Requirements

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