Lets say I have a string array called ar1, ar1[x] is "Harry Potter"
Now lets say I have another string array called ar2, I want ar2[x] to equal "Harry". How would I do this?
Here is something I tried, it did not work.
String ar2[] = new String[10];
int x = 0;
while(x<9){
ar2[x] = ar1[x].split(" ").toString();
x++;
System.out.println(ar2[x]);}}}
the out put was 9 null's.
ar1[x].split(" ")[1]