How do I get a platform-dependent new line character? September 5, 2022 by Tarik Java 7 now has a System.lineSeparator() method.