java -Convert String To Char Array

Public on September 28, 2014
To convert a String to char array, uses String.toCharArray().

CODE : 

public class StringToCharArray {
    public static void main(String[] args) {
 
        String blogNname = "thanhcs94";
        char[] blogNameInCharArray = blogName.toCharArray();
 
        for(char temp: blogNameInCharArray){
            System.out.println(temp);
        }
    }
}


OUTPUT:


t
h
a
n
h
c
s
9
4










[Advertising]Faster Thinking - Speed up your brain


Faster Thinking Game



sentiment_satisfied Emoticon