StringToCharArray Method (Int32, Int32) |
Copies the characters in a specified substring in this instance to a Unicode character array.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax 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:
CharA Unicode character array whose elements are the
length number of characters in this instance starting from character position
startIndex.
Exceptions Exception | Condition |
---|
ArgumentOutOfRangeException | startIndex or length is less than zero.-or- startIndex plus length is greater than the length of this instance. |
See Also