OK so here is some logic thinking… What I am trying to do is loop through strings until I hit a null/empty string.. then STOP. All while putting those strings inside a string array…
Here is a sample of the code. I know it’s wrong but hopefully to give you an idea of what I am trying to achieve:
int i;
wepN = new String[100];
int wepQty = 0;
boolean anyLeft = true;
while (anyLeft == true) {
for(i = 0;i < 100;i++) {
if (data.getItems().get(i).getName() == null) {
anyLeft = false;
System.out.println(data.getItems().get(i).getName() + " -NO MOARE");
}
wepN[i] = data.getItems().get(i).getName();
wepQty++;
}
}
You can use break to exit a for loop, same as you would a switch statement: