Mono Class Library: System.String Overview | Members

System.String.ToCharArray Method

Copies the characters in a specified substring in the current instance to a Unicode character array. [Edit]

public char[] ToCharArray (int startIndex, int length)

Parameters

startIndex
A int containing the index of the start of a substring in the current instance. [Edit]
length
A int containing the length of the substring in the current instance. [Edit]

Returns

A char array whose elements are the length number of characters in the current instance, starting from the index startIndex in the current instance. If the specified length is zero, the entire string is copied starting from the beginning of the current instance, and ignoring the value of startIndex. If the current instance is an empty string, the returned array is empty and has a zero length. [Edit]

Exceptions

TypeReason
ArgumentOutOfRangeException

startIndex or length is less than zero.

-or-

startIndex plus length is greater than the length of the current instance.

[Edit]

Remarks

Documentation for this section has not yet been entered. [Edit]

Requirements

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