Open In App

C# | ToCharArray() Method

In C#, ToCharArray() is a string method. This method is used to copy the characters from a specified string in the current instance to a Unicode character array or the characters of a specified substring in the current instance to a Unicode character array. This method can be overloaded by changing the number of arguments passed to it.

Syntax:



public char[] ToCharArray()
or
public char[] ToCharArray(int startIndex, int length)

Explanation:

Important Points:



Below are the programs to demonstrate the above Methods :

References :


Article Tags :
C#