标签:
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的数
}
}
}
JAVA中 我要将字符串以空格为标记分割成多个字符串,并将分割后的字符串设为一个字符串数组
标签:
原文地址:http://www.cnblogs.com/lingyi1111/p/4428762.html