正文

Java中字符串转换为字符数组,可以这样操作:使用String类的toCharArray()方法。例如:“Hello World”转换为字符数组后的结果是:{'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd'}。