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

ArrayListtoList(String str)
Converts a string to a list of Characters.
ArrayList<Character> myArrayList = new ArrayList<>(str.length());
for (int i = 0; i < str.length(); i++) {
    myArrayList.add(i, str.charAt(i));
return myArrayList;
ArrayListtoList(String string)
Converts a string to a new, mutable list of Characters.
ArrayList<Character> list = new ArrayList<Character>(string.length());
for (char c : string.toCharArray()) {
    list.add(c);
return list;
CollectiontoList(String text)
to List
HashSet<String> list = null;
if (text == null) {
    return list;
String[] split = text.split(DELIMITER);
if (split == null || split.length == 0) {
    return list;
list = new HashSet<>();
Collections.addAll(list, split);
return list;
ListtoList(String transaction)
to List
String[] items = transaction.trim().split(",");
List<String> list = new ArrayList<String>();
for (String item : items) {
    list.add(item);
return list;
ListtoList(String val)
to List
List<String> list = new ArrayList<String>();
int len = val.length();
int inside = 0;
char c;
int begin = 0;
for (int i = 0; i < len; i++) {
    c = val.charAt(i);
    if (c == '"') {
...
ListtoList(String val, String separator)
to List
List<String> list = new ArrayList<String>();
if (!isEmpty(val) && val.indexOf(separator) > -1) {
    String[] arr = val.split(separator);
    for (String item : arr) {
        if (!isEmpty(item)) {
            list.add(item);
return list;