Perhaps my use of "terminator" is incorrect.
I have two simple text files such that file1.txt consists of a single line
of text (no crlf), and file2.txt consists of the identical line of text
followed by a second blank line (implying the line is terminated with crlf,
no?). After retrieving each line using readLine and assigning the lines to
strings, the equals method indicates the two strings are equal.
I would have thought they'd be different given that the line read from
file2.txt is terminated with crlf.
"Roedy Green" <see_website@mindprod.com.invalid> wrote in message
news:bgafb3pcppk35t1oa1j4l3a1t3mfsmndpb@4ax.com...
On Mon, 6 Aug 2007 18:40:42 -0400, "DJ" <ddjames@tampabay.rr.com>
wrote, quoted or indirectly quoted someone who said :
For instance, a line of text terminated with crlf (newline) was
determined equal to the same line of text without the crlf termination.
that makes no sense. You don't have a line unless there is a
terminator. BufferedReader treats \r\n and \n both as line
terminators in Windows.
If you were interested in the details of the line terminator, use read
rather than readLine so that it gets passed through to the app.
See http://mindprod.com/applet/fileio.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Reads a line of text. A line is considered to be terminated by any
return followed immediately by a linefeed.