public class Test {
public static void main(String[] args) {
String str = "asfewgt";
char[] ch = str.toCharArray();
for (int i = 0; i < ch.length; i++) {
System.out.print(String.valueOf(ch[i]) + '\t');
}
}
}
这样可以:
public class Print {
public static void main(String[] args) {
String s = "dfjlskdf";
char [] ss = s.toCharArray();
}
}
String str = "abcdefg";
char[] cha = str.toCharArray();
String str = "123";
char [] chs = str.toCharArray();
干嘛去了,赶紧结贴啊。浪费我时间