I want to create a String from an ArrayList. Currently, I am only able to return the last value from the ArrayList. My code:
eachstep = new ArrayList<String>();
for (int i = 0; i < parsedsteps.size(); i++) {
eachstep.add(parsedsteps.get(i).replaceAll("<[^>]*>", ""));
}
for (int i = 0; i < eachstep.size(); i++) {
String directions = i + "."+" "+eachstep.get(i)+"\n"+;
}
Gives me:
3. This is step 3.
Instead of:
1. This is step 1.
2. This is step 2.
3. This is step 3.
How do I make my for loop create a String with all the values from the ArrayList?