public static List<String> splitLines(String text){
  List<String> list=new ArrayList<>();
  if (text != null) {
    String lines[]=text.split("\r?\n|\r");
    list.addAll(Arrays.asList(lines));
  }
  return list;
}

public static List < String > splitLines ( String text ) { List < String > list = new ArrayList < > ( ) ; if ( text != null ) { String lines [ ] = text . split ( "\r?\n|\r" ) ; list . addAll ( Arrays . asList ( lines ) ) ; } return list ; }
split the string in lines ; separate by cr , lf or crlf .
