Here you can find the source of splitMultiline(String text, boolean trimLines)
public static List<String> splitMultiline(String text, boolean trimLines)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static List<String> splitMultiline(String text, boolean trimLines) { final List<String> result = new ArrayList<>(); final String[] lines = text.split("\\r\\n|\\n|\\r"); for (String line : lines) { result.add(trimLines ? line.trim() : line); }//from w w w.j a v a 2s . com return result; } }