Java-toCharArray()
作者:互联网
public class Test {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
String str = input.next();
char ss[] = str.toCharArray(); //利用toCharArray方法转换
for (int i = 0; i < ss.length; i++) {
System.out.println(ss[i]);
}
}
}
//从零开始依次提取字符串中的字符并依次换行输出。
标签:Java,String,ss,System,toCharArray,input,public 来源: https://www.cnblogs.com/qiyingqizi/p/15059841.html