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的数
   }
}
}

posted @ 2015-04-15 15:38  减掉一斤是一斤  阅读(908)  评论(0编辑  收藏  举报