如何将字符串拆分成字符数组

String str = "sdfghjk";
char[] char1 = str.toCharArray();
for (char c : char1) {
System.out.println(c);
}

posted @ 2019-06-27 17:54  Java精进之路  阅读(13075)  评论(0编辑  收藏  举报