Java Utililty Methods String Split

List of utility methods to do String Split

Description

The list of methods to do String Split are organized into topic(s).

Method

String[]split(final String toSplit)
Splits string into strings array separating it with comma
return split(toSplit, ",");
Listsplit(Iterable objects, boolean even)
split
boolean splitEven = even;
List<T> parts = new ArrayList<T>();
for (T element : objects) {
    if (splitEven) {
        parts.add(element);
    splitEven = !splitEven;
return parts;
Listsplit(String arg)
Converts a comma-delimited string to a list
return split(arg, ",");
Listsplit(String candidate)
split
final List<String> parts = new ArrayList<String>();
int index = candidate.indexOf(':');
while (index > 0) {
    final String strLenght = candidate.substring(0, index);
    final int size = Integer.parseInt(strLenght);
    final String part = candidate.substring(index + 1, index + size + 1);
    parts.add(part);
    candidate = candidate.substring(index + size + 1);
...
String[]split(String cmd)
split
List<String> splitList = new ArrayList<String>();
split(splitList, cmd);
return splitList.toArray(new String[splitList.size()]);
String[]split(String content)
Split the given content by comma.
content = content.trim();
int idx = content.indexOf(',');
if (idx < 0) {
    return new String[] { content };
} else if (content.indexOf('"') < 0) {
    return content.split("\\,", -1);
} else {
    List<String> parts = new ArrayList<>();
...
String[]Split(String content, String sub_seq)
Split
int start_index = 0;
ArrayList<String> ret = new ArrayList<String>();
int pos = -1;
while (start_index < content.length() && (pos = content.indexOf(sub_seq, start_index)) != -1) {
    ret.add(content.substring(start_index, pos + sub_seq.length()));
    start_index = pos + sub_seq.length();
if (start_index < content.length()) {
...
String[]split(String input)
Splits an input string into a an array of strings, seperating at commas.
return split(',', input);
Listsplit(String input)
split
return split(input, defaultDelimiter);
String[]split(String input)
split
if (!input.contains("\"")) {
    return input.split(" ");
ArrayList<String> l = new ArrayList<String>();
boolean isInQuotes = false;
String stack = "";
for (int i = 0; i < input.length(); i++) {
    if (input.charAt(i) == '\"') {
...