String test = "@@@@";
String[] arrayTest = test.split("\\@");
System.out.println(arrayTest.length);
輸出為0,split為忽略空值,如果要想取得正確的值,需要:
String test = "@@@@";
String[] arrayTest = test.split("\\@",-1);
System.out.println(arrayTest.length);
這時輸出就是5了
