如何在文件读取期间跳过空字符串?

时间:2015-07-21 07:17:29

标签: java

示例:

Java is a set of several computer software
and specifications developed by Sun Microsystems,
("PROBLEM HOW DO I SKIP THIS SPACE BELOW?") 

later acquired by Oracle Corporation, that provides
a system for developing application software and
deploying it in a cross-platform computing environment.

我想知道如何使用Java忽略输出文件中的空白行。

1 个答案:

答案 0 :(得分:4)

这是伪代码时间! \ O /

while (file is not read completely) {
    line = read a line from file;
    if (line is empty) {
        continue; // skip this line!
    }
    process line;
}