Java String to List convertTextToStringList(String text)

Here you can find the source of convertTextToStringList(String text)

Description

convert Text To String List

License

Open Source License

Declaration

public static List<String> convertTextToStringList(String text) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Arrays;
import java.util.List;

public class Main {
    public static List<String> convertTextToStringList(String text) {
        List<String> list = null;
        if (text != null) {
            text = text.replace("\r\n", "\n");
            text = text.replace("\n\r", "\n");
            text = text.replace("\r", "\n");
            String[] split = text.split("\n");
            list = Arrays.asList(split);
        }//from   ww w .  j  ava  2 s  .  c  om
        return list;
    }
}

Related

  1. convertStringToEnumList(Class enumType, List stringList)
  2. convertStringToList(String str)
  3. convertStringToList(String string, String delimiter, boolean trim)
  4. convertStringToList(String value, String delimiter)
  5. convertTextToStringList(String tagText)
  6. convertToList(String inputString)
  7. convertToList(String str)
  8. convertToList(String string, String delim)
  9. convertToList(String vars)