Answers for "how to convert string in char arrayin java"

27

java string to char array

String str = "example";
char[] ch = str.toCharArray();
Posted by: Guest on March-05-2020
0

java char array to string

final char[] charArray = { 'g','e','e','k','s','f','o','r','g','e','e','k','s' };
    String string = new String(charArray);

	System.out.println(string);

	// -> "geeksforgeeks"
Posted by: Guest on May-28-2021

Code answers related to "how to convert string in char arrayin java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language