Java String to List toList(String s, String delim)

Here you can find the source of toList(String s, String delim)

Description

to List

License

Apache License

Declaration

public static List toList(String s, String delim) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;
import java.util.Arrays;

import java.util.List;

public class Main {

    public static List toList(String s, String delim) {
        if (isNull(s))
            return new ArrayList(0);
        return Arrays.asList(s.split(delim));
    }/*from  w w w.  jav a 2s . c om*/

    public static boolean isNull(Object s) {
        if (s == null || s.toString().trim().length() == 0 || s.equals("null"))
            return true;
        else
            return false;
    }
}

Related

  1. strToList(String str, String separator)
  2. strToList(String str, String split)
  3. strToList(String value)
  4. toList(String list)
  5. toList(String s)
  6. toList(String s, String delimiter)
  7. toList(String str)
  8. toList(String str)
  9. toList(String string)