class Test{
public static void main(String[] arg){
String str1="a,,";
String str2="a,,b";
System.out.println(str1+" len="+str1.split(",").length);
System.out.println(str2+" len="+str2.split(",").length);
}
}
The output is
a,, len=1
a,,b len=3
Isn't the number of parts supposed to be 3 in both the cases?