public class App { public static void main(String[] args) { String str = "123\\n456\\n789\\n"; //字符串"123\n456\n789\n" String[] strs = str.split("\\\\n"); for (String s : strs) { System.out.println(s); //123 456 789 } } }