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.62] | The information on this page is for non-military use only. | ||
| You are visitor number 6,125. | Military use includes use by defence contractors. | ||
| You can get a fresh copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) | ||
| http://mindprod.com/jgloss/lineseparator.html | J:\mindprod\jgloss\lineseparator.html | ||