Answers for "Character to char array"

27

java string to char array

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

converting char array to string

// Convert char array to String in Java
class Util
{
    public static void main(String[] args)
    {
        char[] chars = {'T', 'e', 'c', 'h', 'i', 'e', ' ', 
                        'D', 'e', 'l', 'i', 'g', 'h', 't'};
 
        String string = new String(chars);
        System.out.println(string);
    }
}
Posted by: Guest on February-26-2020

Code answers related to "Character to char array"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language