JAVA中 我要将字符串以空格为标记分割成多个字符串,并将分割后的字符串设为一个字符串数组

public class Test {

public static void main(String[] args) {

String string="a b c d e f g";

String Count[] = string.split(" "); //遇到空格就拆分。

for(int i=0;i<Count.length;i++)

{

System.out.println(Count[i]); //输出数组Count的数

}

}

}