日期:2014-05-17 浏览次数:20870 次
String str="****有限公司,好不werewr,,3324rr,2342334234,1,0,2011-07-28,,,,,,,,"; String[] a=new String[16]; a=str.split(",",16); for(String s:a){ System.out.println(":"+s+":"); } System.out.println("length:"+a.length);
------解决方案--------------------
for example
String s = ",,,,,,,,,,,,,,,"; String[] sa = s.split(",", -1); //分割的是后带上参数-1 System.out.println(sa.length);