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. Internal implementationSignatureThe signature or syntax of string toCharArray() method is given below: Returnscharacter array Java String toCharArray() method exampleTest it NowOutput: hello Java String toCharArray() Method Example 2Let's see one more example of char array. It is useful method which returns char array from the string without writing any custom code. Output: 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 Next TopicJava String toLowerCase() |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India