If you use the readLine and println methods, Java automatically deals with the platform differences for you.
You can discover the magic line ending String with:
/** get the platform's String to mark the end of each line */ static final String lineSeparator = System.getProperty ( "line.separator" );The last line in a file may or may not have a line separator.
![]() |
and suggestions to improve this page to Roedy Green : | ||
| Canadian Mind Products | |||
| mindprod.com IP:[65.110.21.43] | |||
| Your face IP:[38.103.63.16] | ![]() | ||
| You are visitor number 2,078. | |||
| You can get a fresh copy of this page from: | or possibly from your local J: drive (Java virtual drive/Mindprod website mirror) | ||
| http://mindprod.com/jgloss/lineseparator.html | J:\mindprod\jgloss\lineseparator.html | ||