How do I get a platform-independent new line character? October 1, 2023 by Tarik Java 7 now has a System.lineSeparator() method.