How do I get a platform-dependent new line character?

Spoike picture Spoike · Oct 16, 2008 · Viewed 431.6k times · Source

How do I get a platform-dependent newline in Java? I can’t use "\n" everywhere.

Answer

StriplingWarrior picture StriplingWarrior · Jun 7, 2012

Java 7 now has a System.lineSeparator() method.