¿Por qué un "" en el índice 0 de una matriz al perforar un split () sin delimitadores?
public static void main(String[] args) {
// TODO Auto-generated method stub
String str="aaabbddaabbcc";
String[] str2=str.split("");
String pointer=str2[0];
int count=0;
String finalStr="";
for(String str132:str2)
{
if(str132.equalsIgnoreCase(pointer))
{
++count;
}
else
{
finalStr+=str132+count;
count=0;
pointer=str132;
++count;
}
}
System.out.println(finalStr);
}
Al realizar unstr.split("")
, ¿por qué estoy obteniendo un""
en el índice 0 de lastr2
¿formación?