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

ListstringToList(String input)
string To List
List<String> list = new ArrayList<String>();
for (String element : input.split("-")) {
    list.add(element);
return list;
ListstringToList(String keywords, String delimiter)
string To List
if (keywords == null || keywords.length() == 0 || delimiter == null
        || delimiter.length() == 0 | keywords.indexOf(delimiter) < 0)
    return Collections.emptyList();
final List<String> elements = new ArrayList<String>();
int index = -1;
while ((index = keywords.indexOf(delimiter)) >= 0) {
    if (index > 0)
        elements.add(keywords.substring(0, index));
...
ListstringToList(String listString, String delimiter)
string To List
ArrayList<String> result = new ArrayList<String>();
int last = -1;
if (listString != null && !listString.isEmpty()) {
    while (listString.indexOf(delimiter, ++last) != -1) {
        result.add(listString.substring(last, listString.indexOf(delimiter, last)));
        last = listString.indexOf(delimiter, last);
    result.add(listString.substring(last, listString.length()));
...
ListstringToList(String listText)
string To List
if (listText == null || listText.equals("")) {
    return null;
List<Object> list = new ArrayList<Object>();
String[] text = listText.split(SEP1);
for (String str : text) {
    list.add(str);
return list;
ListStringToList(String listText, String regex)
String To List
if (listText == null || listText.equals("")) {
    return null;
List<String> list = new ArrayList<String>();
if (listText.contains(regex)) {
    String[] text = listText.split(regex);
    for (String str : text) {
        list.add(str.replaceAll("\\s*", ""));
...
ListstringToList(String s)
string To List
return Arrays.asList(splitOnSpaces(s));
ArrayListstringToList(String s)
string To List
ArrayList<String> l = new ArrayList<String>();
if ((s != null) && (s.length() > 0)) {
    String[] stringTokens = s.split("\\s");
    for (int i = 0; i < stringTokens.length; i++)
        l.add(stringTokens[i].toUpperCase());
return l;
ListstringToList(String s)
string To List
return stringToList(s, null);
ListstringToList(String source)
Comma separated strings to List
return Arrays.asList(source.split("\\s*,\\s*"));
ListstringToList(String sText)
string To List
if (sText == null || sText.length() == 0)
    return new ArrayList(0);
if (sText.startsWith("[") && sText.endsWith("]")) {
    sText = sText.substring(1, sText.length() - 1);
ArrayList arrayList = new ArrayList();
int iIndexOf = 0;
int iBegin = 0;
...