Lets say I have 1d array
String teams[]={"Michael-Alex-Jessie","Shane-Bryan"};
and I want to convert it to multidimensional array which will be like this
String group[][]={{Michael,Alex,Jessie},{Shane,Bryan}}.
I try to use delimeter but for unknown reason I cannot assign the value of 1d to 2d array. It said incompatible types. Please any help will be much appreciated. Here is my code.
String [][]groups ;
String teams[]={"Michael-Alex-Jessie","Shane-Bryan"};
int a=0,b=0;
String del ="-/";
for (int count = 0; count < teams.length; count++)
{
groups[a][b] = teams[count].split(del);
a++;
}
groups = new String[x][y]) - also, whenever asking a question where you're getting an error message, you want to post the error message as well.