Pinyo's Programming and Software Notes

Wednesday, June 28, 2006

Java "cross platform" new-line character:
(June 28, 2006)

Since "\n" may not be accepted as a new-line character in some Windows applications, such as Notepad, we should find an easy way to get the corresponding new-line character for each platform. Java provides us a function for this. We can obtain the corresponding new-line character as follows:
final String newline = System.getProperty("line.separator");

0 Comments:

Post a Comment

<< Home