Click or drag to resize
StringToCharArray Method (Int32, Int32)
Copies the characters in a specified substring in this instance to a Unicode character array.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public char[] ToCharArray(
	int startIndex,
	int length
)

Parameters

startIndex
Type: SystemInt32
The starting position of a substring in this instance.
length
Type: SystemInt32
The length of the substring in this instance.

Return Value

Type: Char
A Unicode character array whose elements are the length number of characters in this instance starting from character position startIndex.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionstartIndex or length is less than zero.-or- startIndex plus length is greater than the length of this instance.
See Also