NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

String.ToCharArray (Int32, Int32)

Returns a substring of this string as an array of characters.

[Visual Basic]
Overloads Public Function ToCharArray( _
   ByVal startIndex As Integer, _
   ByVal length As Integer _
) As Char ()
[C#]
public char[] ToCharArray(
   int startIndex,
   int length
);
[C++]
public: __wchar_t* ToCharArray(
   int startIndex,
   int length
) [];
[JScript]
public function ToCharArray(
   startIndex : int,
   length : int
) : Char[];

Parameters

startIndex
The position the substring begins.
length
The length of the substring.

Return Value

Returns a character array.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException If the substring is longer than the string.
ArgumentOutOfRangeException If substring less than zero.
ArgumentOutOfRangeException If the starting position of the substring is not in the string.

Remarks

The ToCharArray method returns a character array containing the characters beginning at the specified start position (startIndex) through the ending at the length (startIndex + length- 1).

See Also

String Class | String Members | System Namespace | String.ToCharArray Overload List | Array | Char | Int32