Java examples for java.lang:String New Line
Break Up Lines in string via regex
//package com.java2s; public class Main { public static void main(String[] argv) { String string = "b\n\n\nook2s.com"; System.out.println(java.util.Arrays.toString(BreakUpLines(string))); }/*w w w . java2s .c om*/ public static String[] BreakUpLines(String string) { return string.split("[\\n\\t]"); } }