语法Java:如何判断文本文件中的一行是否应该为空?
我正在做一个项目,我必须读入一个语法文件(将它分解成我的数据结构),目标是能够生成一个随机的“DearJohnLetter”
我的问题是,当在教室里看书时。txt文件,我不知道如何找出该文件是否应该是一个完全空白行,这是有害的程序
下面是一个文件部分的示例,如何判断下一行是否应该是空行?(顺便说一句,我只是使用一个缓冲阅读器)谢谢
<start>
I have to break up with you because <reason> . But let's still <disclaimer> .
<reason>
<dubious-excuse>
<dubious-excuse> , and also because <reason>
<dubious-excuse>
my <person> doesn't like you
I'm in love with <another>
I haven't told you this before but <harsh>
I didn't have the heart to tell you this when we were going out, but <harsh>
you never <romantic-with-me> with me any more
you don't <romantic> any more
my <someone> said you were bad news
# 1 楼答案
如果我没弄错的话,你只想在一行中确定下一行是否为空
如果为真,那么这里有一个启动示例:
这将打印以下内容: