Java String.split()的bug?

以下程序:

String str1 = "a,b,,,,";
System.out.println("String length is: " + str1.split(",").length);
		
String str2 = "a,b,,,,c";
System.out.println("String length is: " + str2.split(",").length);

 输出:

String length is: 2
String length is: 6

 

你可能感兴趣的:(java,split)