Here you can find the source of stringToList(String content)
public static List<String> stringToList(String content)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static List<String> stringToList(String content) { if (content == null) { return new ArrayList<String>(); }/*w w w . j a v a 2s .c o m*/ content = content.replace("\r", ""); String[] listArray = content.split("\n"); List<String> returnList = new ArrayList<String>(); for (String element : listArray) { returnList.add(element); } return returnList; } }