Java String Split by Regex split(String str, String regex)

Here you can find the source of split(String str, String regex)

Description

split

License

Open Source License

Declaration

public static List<String> split(String str, String regex) 

Method Source Code

//package com.java2s;

import java.util.Arrays;
import java.util.List;

public class Main {

    public static List<String> split(String str, String regex) {

        List<String> strList = null;
        if (str == null || str.equals("")) {
            return strList;
        }//from  w  w  w .j  a  v a  2  s  . c  o  m

        strList = Arrays.asList(str.split(regex));

        return strList;
    }
}

Related

  1. split(final String regex, final String value)
  2. split(final String string, final String regex)
  3. split(String input, String regex)
  4. split(String str, String regex)
  5. split(String string, String pattern)
  6. split(String text, String pattern)
  7. splitAndTrim(String s, String regex)