Java String Split by Separator split(String left, String separator)

Here you can find the source of split(String left, String separator)

Description

split

License

Apache License

Declaration

private static List<String> split(String left, String separator) 

Method Source Code

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

import java.util.ArrayList;
import java.util.List;

public class Main {
    private static List<String> split(String left, String separator) {
        List<String> results = new ArrayList<>();
        if (left == null || left.isEmpty())
            return results;
        for (String str : left.split(separator)) {
            if (str != null && !str.isEmpty())
                results.add(str);/*from   www .j  a v  a2  s  . co m*/
        }
        return results;
    }
}

Related

  1. split(final String text, final char separator)
  2. split(final String text, final String separator)
  3. split(final T string, final char separator)
  4. split(String array, String separators)
  5. split(String input, int separator)
  6. split(String s, char separator)
  7. split(String s, char separator)
  8. split(String s, char separator)
  9. split(String s, char separator)