The java string toCharArray() method converts the given string into a sequence of characters. The returned array length is equal to the length of the string.
public char toCharArray() Return : It returns a newly allocated character array.
G e e k s f o r G e e k s
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- CharArrayWriter toCharArray() method in Java with examples
- Convert a List of String to a comma separated String in Java
- Convert a Set of String to a comma separated String in Java
- Collator equals(String, String) method in Java with Example
- Convert an ArrayList of String to a String array in Java
- Collator compare(String, String) method in Java with Example
- String Literal Vs String Object in Java
- Convert Set of String to Array of String in Java
- Java.lang.string.replace() method in Java
- Insert a String into another String in Java
- Java.lang.String.getByte() in Java
- Java.lang.String.startswith() in Java
- Java.lang.String class in Java | Set 2
- Java.lang.String.copyValueOf() in Java
- Java.lang.String.matches() in Java
- Java.lang.String.replace() in Java
- How to pad a String in Java
- Java String indexOf()
- Reverse a string in Java
- Interning of String in Java
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.