Java Utililty Methods String to List

List of utility methods to do String to List

Description

The list of methods to do String to List are organized into topic(s).

Method

ListconvertStringToEnumList(Class enumType, List stringList)
convert String To Enum List
List<T> enumList = new ArrayList<T>();
for (String string : stringList) {
    enumList.add(Enum.valueOf(enumType, string));
return enumList;
ListconvertStringToList(String str)
convert String To List
List<String> stList = new ArrayList<>();
stList.add(str);
return stList;
ListconvertStringToList(String string, String delimiter, boolean trim)
Converts string to list.
if (string == null || string.length() == 0) {
    return new LinkedList();
String[] members = string.split(delimiter);
List list = Collections.synchronizedList(new LinkedList());
for (int i = 0; i < members.length; i++) {
    String member = members[i];
    if (trim) {
...
ListconvertStringToList(String value, String delimiter)
convert String To List
List<String> list = null;
if (value != null) {
    list = Arrays.asList(value.split(","));
return list;
ListconvertTextToStringList(String tagText)
Convert tag text to list of seperated words
List<String> result = new ArrayList<String>();
StringBuilder builder = new StringBuilder();
if (allUpperCase(tagText) || allLowerCase(tagText)) {
    result.add(tagText);
} else {
    for (int i = tagText.length() - 1; i >= 0; --i) {
        char ch = tagText.charAt(i);
        if (Character.isLowerCase(ch)) {
...
ListconvertTextToStringList(String text)
convert Text To String List
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);
return list;
ListconvertToList(String inputString)
converts a given comma separated String into a list of Strings
ArrayList<String> list = new ArrayList<String>();
if (inputString == null || inputString.equals("")) {
    return list;
String[] strings = inputString.split(",");
for (String s : strings) {
    list.add(s);
return list;
ListconvertToList(String str)
Create an ArrayList and add the str value to its 0 index and return it.
if (str == null)
    return null;
List<String> strList = new ArrayList<String>();
strList.add(str);
return strList;
ListconvertToList(String string, String delim)
Construct a list from a string.
String elem_d = "\\Q" + delim + "\\E";
String elems[] = string.split(elem_d);
return new ArrayList<String>(Arrays.asList(elems));
ListconvertToList(String vars)
Converts comma-separated string into a list.
List<String> resultList = new ArrayList<String>();
String[] resultArray = vars.split(STRING_LIST_SEPARATOR);
for (String var : resultArray) {
    var = var.trim();
    if (var.length() > 0) {
        resultList.add(var);
return resultList;