Here you can find the source of stringToListByLine(final String fileContent)
public static List<String> stringToListByLine(final String fileContent) throws Exception
//package com.java2s; import java.util.LinkedList; import java.util.List; public class Main { public static List<String> stringToListByLine(final String fileContent) throws Exception { List<String> lineList = new LinkedList<String>(); for (String line : fileContent.split("\n")) { lineList.add(line);// ww w . j a va 2 s. c om } return lineList; } }