asp.net.ph

String.CopyTo Method

System Namespace   String Class


Copies a specified number of characters from a specified position in the given String to a specified position in an array of Unicode characters.

[ VB ]
<Serializable>
Public Sub CopyTo ( _
   ByVal sourceIndex As Integer, _
   ByVal destination ( ) As Char, _
   ByVal destinationIndex As Integer, _
   ByVal count As Integer _
)

[ C# ]
[ Serializable ]
public void CopyTo (
   int sourceIndex,
   char [ ] destination,
   int destinationIndex,
   int count
);

[ C++ ]
[ Serializable ]
public: void CopyTo (
   int sourceIndex,
   __wchar_t destination __gc [ ],
   int destinationIndex,
   int count
);

[ JScript ]
public Serializable
function CopyTo (
   sourceIndex : int,
   destination : Char [ ],
   destinationIndex : int,
   count : int
);

Parameters

sourceIndex
A character position in the given String.
destination
An array of Unicode characters.
destinationIndex
An array element in destination.
count
The number of characters in the given String to copy to destination.

Exceptions


Exception Type Condition
ArgumentNullException destination is a null reference ( Nothing in Visual Basic ).
ArgumentOutOfRangeException sourceIndex, destinationIndex, or count is negative

-or-

count is greater than the length of the substring from startIndex to the end of this instance

-or-

count is greater than the length of the subarray from destinationIndex to the end of destination


Remarks

count characters are copied from the sourceIndex position of this instance to the destinationIndex position of destination.

sourceIndex and destinationIndex are zero-based.

See Also

String Members   Char   Int32   Insert   Substring 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