@Test public void testSplitLinesSkipEmptyLines() { String[] lines = StringUtils.splitLines(LINES, true); assertEquals(5, lines.length); assertEquals("Line 1", lines[0]); assertEquals("Line 2", lines[1]); assertEquals("Line 4", lines[2]); assertEquals("Line 5", lines[3]); assertEquals("Line 7", lines[4]); }
public static String[] splitLines(String text, boolean skipEmptyLines) { if (skipEmptyLines) { return text.split("[\n\r]+"); } else { return text.split("\\r?\\n"); } }
StringUtils { public static String[] splitLines(String text, boolean skipEmptyLines) { if (skipEmptyLines) { return text.split("[\n\r]+"); } else { return text.split("\\r?\\n"); } } }
StringUtils { public static String[] splitLines(String text, boolean skipEmptyLines) { if (skipEmptyLines) { return text.split("[\n\r]+"); } else { return text.split("\\r?\\n"); } }  }
StringUtils { public static String[] splitLines(String text, boolean skipEmptyLines) { if (skipEmptyLines) { return text.split("[\n\r]+"); } else { return text.split("\\r?\\n"); } }  static String[] split(String string, char delimiter); static String encodeUrl(String stringToEncode); static String encodeUrlIso(String stringToEncode); static String decodeUrl(String stringToDecode); static String decodeUrlIso(String stringToDecode); static String md5(String stringToEncode); static String sha1(String stringToEncode); static String digest(String string, String digestAlgo, String encoding); static String hex(byte[] bytes); static byte[] parseHex(String hex); static int parseHexDigit(char c); static String resolveEntity(String entity); static String ellipsize(String text, int maxLength); static String ellipsize(String text, int maxLength, String end); static String[] splitLines(String text, boolean skipEmptyLines); static List<String> findLinesContaining(String text, String searchText); static String join(Iterable<?> iterable, String separator); static String join(int[] array, String separator); static String join(String[] array, String separator); }
StringUtils { public static String[] splitLines(String text, boolean skipEmptyLines) { if (skipEmptyLines) { return text.split("[\n\r]+"); } else { return text.split("\\r?\\n"); } }  static String[] split(String string, char delimiter); static String encodeUrl(String stringToEncode); static String encodeUrlIso(String stringToEncode); static String decodeUrl(String stringToDecode); static String decodeUrlIso(String stringToDecode); static String md5(String stringToEncode); static String sha1(String stringToEncode); static String digest(String string, String digestAlgo, String encoding); static String hex(byte[] bytes); static byte[] parseHex(String hex); static int parseHexDigit(char c); static String resolveEntity(String entity); static String ellipsize(String text, int maxLength); static String ellipsize(String text, int maxLength, String end); static String[] splitLines(String text, boolean skipEmptyLines); static List<String> findLinesContaining(String text, String searchText); static String join(Iterable<?> iterable, String separator); static String join(int[] array, String separator); static String join(String[] array, String separator);  }