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 代码 str.toCharArray()
$str = "Hello Friend";
$arr1 = str_split($str);
PHP代码str_split