java - Check if readLine is blank, but don't read a line -
i have while loop performs while readline != "". problem is, reads line , moves on next one, not want. need either test whether line blank without moving on next line, or go before reading it.
thanks in advance.
while (filereader.readline() != "") { string readline = filereader.readline(); }
you provided little information, guess problem don't have actual string inside loop body. correct me if i'm wrong.
to address problem, do:
string line; while(((line = reader.readline()) != null) && !("".equals(line))) { system.out.println("line: "+line); }
Comments
Post a Comment