the variable TEST is equal to this
[email protected]_Hd_s [email protected]_Update_on the [email protected]_Ksks_ajsj
i want to pull each "product" out so i have an ArrayList equal to this
[email protected]_Hd_s
[email protected]_Update_on
[email protected]_Ksks_ajsj
Right now the only thing in my array list is [email protected]_Hd_s
How can i pull each "product" from the one variable (TEST) in a loop and add it to the ArrayList?
My code so far:
String TEST = result;
ArrayList<String> Products = new ArrayList<>();
boolean flag = true;
while(flag == true){
Products.add(TEST.substring(0, TEST.indexOf(' ')));
TEST = TEST.substring(TEST.indexOf(' ') + 1);
if(TEST.equals("")){
flag = false;
}else{
TEST = TEST.substring(1);
}
}
