asp.net.ph

String.ToCharArray Method ( Int32, Int32 )

System Namespace   String Class


Copies the characters in a specified substring in the given String to a Unicode character array.

[ VB ]
<Serializable>
Overloads Public Function ToCharArray ( _
   ByVal startIndex As Integer, _
   ByVal length As Integer _
) As Char ( )

[ C# ]
[ Serializable ]
public char [ ] ToCharArray (
   int startIndex,
   int length
);

[ C++ ]
[ Serializable ]
public: __wchar_t ToCharArray (
   int startIndex,
   int length
) __gc [ ];

[ JScript ]
public Serializable
function ToCharArray (
   startIndex : int,
   length : int
) : Char [ ];

Parameters

startIndex
The starting position of a substring in the given String.
length
The length of the substring in the given String.

Return Value

A Unicode character array whose elements are the length number of characters in the given String starting from character position startIndex.

Exceptions


Exception Type Condition
ArgumentOutOfRangeException startIndex or length is less than zero.

-or-

startIndex plus length is greater than the length of this instance.


Remarks

If length is zero, the entire string is copied starting from the beginning of this instance, and ignoring the value of startIndex. If this instance is an empty string, the returned array is empty and has a zero length.

See Also

String Members   String.ToCharArray Overload List   Array   Char   Int32 Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph