String input = stack.pop();
if ((index = input.indexOf('*')) != -1) {
for (char c = '0'; c <= '1'; c++) {
input = input.substring(0, index) + c +
input.substring(index + 1);
stack.push(input);
}
}
I'm struggling to understand what's happening in the for loop. Can someone clarify how it iterates? I'm not used to having something other than the length of the array as the second parameter.