Where there is a will, there is a way
拆分为Where there is a will there is a way。注意此时length=9
java">public class Split{
public static void main(String[] args){
String sss = "1 2010,2 2011,3 2012";
String[] arr = sss.split(" |,");//根据“ ”和“,”区分
System.out.println(java.util.
1.可能是你程序里用的是英文的“,”,而你在控制台输入的是中文的“,”导致的吧。
2.我刚试了下,你输入的逗号中间应该有内容空格也行,不然运行结果就是0。
本回答被网友采纳Where there is a will, there is a way
拆分为Where there is a will there is a way。注意此时length=9
额 你这只是把逗号改成空格了啊?