Java String to List stringToList(String s)

Here you can find the source of stringToList(String s)

Description

string To List

License

Open Source License

Declaration

public static List stringToList(String s) 

Method Source Code


//package com.java2s;
import java.util.*;

public class Main {
    public static List stringToList(String s) {
        return stringToList(s, null);
    }/*ww  w  .  jav  a  2  s .c om*/

    public static List stringToList(String s, String delimiter) {

        List newList = new ArrayList();
        StringTokenizer st;
        if (delimiter != null)
            st = new StringTokenizer(s, delimiter);
        else
            st = new StringTokenizer(s);

        while (st.hasMoreTokens()) {
            newList.add(st.nextToken());
        }

        return newList;
    }
}

Related

  1. stringToList(String input)
  2. stringToList(String keywords, String delimiter)
  3. stringToList(String listString, String delimiter)
  4. stringToList(String listText)
  5. StringToList(String listText, String regex)
  6. stringToList(String s)
  7. stringToList(String s)
  8. stringToList(String source)
  9. stringToList(String sText)