Java String toCharArray()
The java string toCharArray() method converts this string into character array. It returns a newly created character array, its length is similar to this string and its contents are initialized with the characters of this string.
The signature or syntax of string toCharArray() method is given below:
Java String toCharArray() method exampleTest it Now
Java String toCharArray() Method Example 2
Let's see one more example of char array. It is useful method which returns char array from the string without writing any custom code.
Char Array length: 21 Char Array elements: W e l c o m e t o J a v a t p o i n t