String s = "wo\nai\nzhong\nguo"; String[] r= s.split("\\n"); for(int i = 0;i < r.length;i++) { System.out.println(r[i]); }输出结果为: wo ai zhong guo