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

ArrayListstringToList(String str)
string To List
str = str.substring(1, str.length() - 1);
String[] sline = str.split(",");
ArrayList<Double> list = new ArrayList<>();
for (String s : sline) {
    list.add(Double.parseDouble(s));
return list;
ListstringToList(String str)
string To List
List<String> list = new ArrayList<>();
if (str != null) {
    String tmp = str.replace('&', ',');
    String[] pieces = tmp.split(",");
    for (String piece : pieces) {
        String target = piece.trim();
        if (target.length() > 0) {
            list.add(target);
...
ListstringToList(String str, char delimiter)
creates a List from a String "List"
ArrayList list = new ArrayList();
int len = str.length();
if (len == 0)
    return list;
StringBuffer el = new StringBuffer();
for (int i = 0; i < len; i++) {
    char c = str.charAt(i);
    if (c == delimiter) {
...
ListstringToList(String str, String delim)
string To List
return Arrays.asList(tokenize(str, delim));
ListstringToList(String string, String separator)
Convert a string of elements separated by a separator into a list.
String[] values = string.split(separator);
List<String> result = new ArrayList<String>();
for (String value : values) {
    result.add(value);
return result;
ListstringToList(String text, String seperator)
string To List
return Arrays.asList(text.split(seperator));
ListstringToList(String toList)
string To List
String[] st = toList.split(";");
List<String> list = new ArrayList<>(Arrays.asList(st));
return list;
ArrayListstringToList(String toList, String delimiter)
Convert string to list
ArrayList<String> list = new ArrayList<String>();
if (toList != null && !toList.isEmpty()) {
    String[] names = toList.split(delimiter);
    for (int i = 0; i < names.length; i++) {
        list.add(names[i]);
return list;
...
ListstringToList(String value)
string To List
if (value == null || value.length() == 0)
    throw new Exception();
if (value.startsWith("["))
    value = value.substring(1);
if (value.endsWith("]"))
    value = value.substring(0, value.length() - 1);
String[] elements = value.split(",");
List<String> list = new ArrayList();
...
ListstringToListOfTags(String p)
Converting a string with a list of tags separated with commas to a list of strings
return Arrays.asList(p.split(","));