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

ArrayListstrToAList(String strTokenize)
Takes a string and returns the array list for that string.
return strToAList(strTokenize, true);
ListstrToList(String str, String regex)
str To List
List<String> list = new ArrayList<String>();
if (str.length() == 0 && "".equals(str)) {
    return list;
} else if (str.length() == 1) {
    list.add(str);
    return list;
String temp[] = str.split(regex);
...
ListstrToList(String str, String separator)
str To List
String[] strArr = str.split(separator);
List<String> strList = new ArrayList<String>();
for (String tmpStr : strArr) {
    strList.add(tmpStr);
return strList;
ListstrToList(String str, String split)
str To List
String[] strs = {};
if (str != null && !"".equals(str)) {
    strs = str.split(split);
List<String> tokenList = new ArrayList<String>();
for (int i = 0; i < strs.length; i++) {
    String temp = strs[i];
    if (temp != null) {
...
ListstrToList(String value)
str To List
List<Object> result = new ArrayList<Object>();
String[] strs = value.split(",");
for (String s : strs) {
    result.add(s);
return result;
ArrayListtoList(String list)
to List
ArrayList l = new ArrayList();
String aux;
aux = list;
while (aux.indexOf(',') > 0) {
    l.add(aux.substring(0, aux.indexOf(',')).trim());
    aux = aux.substring(aux.indexOf(',') + 1);
if (aux.trim().compareTo("") != 0) {
...
ListtoList(String s)
to List
List<String> list = new ArrayList<String>();
if (s != null) {
    for (String x : s.split(",")) {
        x = x.trim();
        list.add(x);
return list;
...
ListtoList(String s, String delim)
to List
if (isNull(s))
    return new ArrayList(0);
return Arrays.asList(s.split(delim));
ListtoList(String s, String delimiter)
to List
if (s == null || s.length() == 0)
    return Collections.emptyList();
final List<String> result = new ArrayList<String>();
final StringTokenizer tokenizer = new StringTokenizer(s, delimiter);
while (tokenizer.hasMoreTokens())
    result.add(tokenizer.nextToken());
return result;
ListtoList(String str)
to List
return toList(str, DEFAULT_SEPARATOR, DEFAULT_ESCAPE_CHAR);