I have a while loop that performs while readLine != “”. The problem is, it reads the line and moves on to the next one, which is not what I want. What I need is either for it to test whether the line is blank without moving on to the next line, or for it to go back to where it was before reading it.
Thanks in advance.
while (fileReader.readLine() != "") {
String readLine = fileReader.readLine();
}
You provided very little information, so I guess your problem is that you don’t have the actual string inside your loop body. Correct me if I’m wrong.
To address this problem, you could do: