The following method only returns the last value, not all the values in the while loop:
I want to return each iteration of index. Not just the last one.public static String Addition(int length, String input) { String index = ""; int add = 0, counter = 0; while(counter < length) { index = input.substring(add, add + 1); add = add + 1; counter++; } return index; }