ToCharArray Method (Int32, Int32)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Copies the characters in a specified substring in this instance to a Unicode character array.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public Function ToCharArray ( _
startIndex As Integer, _
length As Integer _
) As Char()
public char[] ToCharArray(
int startIndex,
int length
)
public:
array<wchar_t>^ ToCharArray(
int startIndex,
int length
)
member ToCharArray :
startIndex:int *
length:int -> char[]
public function ToCharArray(
startIndex : int,
length : int
) : char[]
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: array<System. . :: . .Char> [] () [] []
A Unicode character array whose elements are the length number of characters in this instance starting from character position startIndex.
Remarks
The startIndex parameter is zero-based. That is, the index of the first character in the string instance is zero.
If length is zero, the returned array is empty and has a zero length. If this instance is null Nothing nullptr unit a null reference (Nothing in Visual Basic) or an empty string (""), the returned array is empty and has a zero length.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.