0 votes
1 view
in Java by (3.5k points)

In C# there is the static property Environment.Newline that changed depending on the running platform.

Is there anything similar in Java?

1 Answer

0 votes
by (46.1k points)

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".

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...