String.ToCharArray Method (Int32, Int32)
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Copies the characters in a specified substring in this instance to a Unicode character array.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- startIndex
- Type: System.Int32
The starting position of a substring in this instance.
- length
- Type: System.Int32
The length of the substring in this instance.
Return Value
Type: System.Char []A Unicode character array whose elements are the length number of characters in this instance starting from character position startIndex.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | startIndex or length is less than zero. -or- startIndex plus length is greater than the length of this instance. |
Show: