来自 javadoc
public String readLine()
throws IOException
Read a line of text. A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a linefeed.
我有以下类型的文字:
Now the earth was formless and empty. Darkness was on the surface
of the deep. God's Spirit was hovering over the surface
of the waters.
我正在阅读以下行:
while(buffer.readline() != null){
}
但是,问题是它正在考虑在换行符之前为字符串设置一行。但我想在字符串以 . 结尾时考虑行.
。我该怎么做?