Back
In C# there is the static property Environment.Newline that changed depending on the running platform.
Is there anything similar in Java?
As of Java 7:
System.lineSeparator()
Java API : System.lineSeparator
Returns the system-dependent line separator string. It always returns the same value - the initial value of the system property line.separator. On UNIX systems, it returns "\n"; on Microsoft Windows systems it returns "\r\n".
31k questions
32.8k answers
501 comments
693 users