My For loop is ending early. It’s ending even thought the loop condition is still true:
for (int i = 0; i < currentText.Length; i++) {
if (optionLines == null && currentText*.Contains("option"))*
arrayLength++;
if (i == currentText.Length - 1)
optionLines = new int[arrayLength];
}
currentText.Length is 24, however after variable i is equal to 21 it becomes 0. Why is this happening? The variable i should get to 23 before it restarts and turns into 0 again.