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[]splitSimpleQueries(String queryString)
Split out terms of form "M(QUERY)", or return null if there are no such parentheses-delimited terms.
List<String> pieces = null;
for (int lpPos = queryString.indexOf('('); lpPos >= 0; lpPos = queryString.indexOf('(')) {
    if (lpPos > 0) {
        final char c = queryString.charAt(lpPos - 1);
        if (c == '+' || c == '^')
            --lpPos;
    int rpPos = queryString.indexOf(')') + 1; 
...
voidsplitSQL(List list, String sql)
split SQL
int idx = 0;
int start = 0;
boolean isVar = false;
while (idx < sql.length()) {
    char c = sql.charAt(idx);
    if (c == '@') {
        if (idx > start) {
            list.add(sql.substring(start, idx));
...
String[]splitSQLColumns(String sql)
split SQL columns like that : from : id, name, CONCAT(name,UPPER(address)), CONCAT(age,name) to [id] [name] [CONCAT(name,UPPER(address))] [CONCAT(age,name)]
List<String> result = new ArrayList<String>();
int blockCount = 0;
int start = 0;
for (int i = 0; i < sql.length(); i++) {
    char c = sql.charAt(i);
    if (c == '(') {
        blockCount++;
    } else if (c == ')') {
...
String[]splitStep(String step)
Splits the specified step into parts.
if (step == null) {
    return null;
int offset = 0;
int braces = 0;
ArrayList list = new ArrayList();
for (int index = 0; index < step.length(); index++) {
    switch (step.charAt(index)) {
...
ArrayListsplitStr(String str, int toCount)
split Str
int reInt = 0;
if (str == null)
    return null;
char[] tempChar = str.toCharArray();
int totalChars = tempChar.length;
ArrayList result = new ArrayList();
int totalBytes = 0;
int i = 0;
...
ListsplitString(String bigString, String splitter)
Split a string into a list of substrings separated by splitter.
if (bigString == null || "".equals(bigString.trim()))
    return new ArrayList<String>();
List<String> dataList = new ArrayList<String>();
int spliterLen = splitter.length();
int index = bigString.indexOf(splitter);
while (index != -1) {
    String frontString = bigString.substring(0, index);
    dataList.add(frontString);
...
ListsplitString(String hexString, int partSize)
split String
List<String> parts = new ArrayList<>();
int length = hexString.length();
for (int i = 0; i < length; i += partSize) {
    parts.add(hexString.substring(i, Math.min(length, i + partSize)));
return parts;
ListsplitString(String s)
split String
if (s.length() < 256) {
    return Collections.singletonList(s);
List<String> list = new ArrayList<>();
int lastPos = 0;
for (int i = 0; i < s.length(); i++) {
    if (i % 255 == 0) {
        list.add(s.substring(lastPos, i));
...
String[]splitString(String s)
split String
if (s == null)
    return new String[0];
ArrayList<String> ret = new ArrayList<String>();
int pos = 0;
while (true) {
    int end = findNext(s, CRLF, pos);
    if (end < 0) {
        ret.add(s.substring(pos));
...
String[]splitString(String s)
split String
if (indexOfAny(s, delimeters) == -1) {
    String[] sa = new String[1];
    sa[0] = s;
    return sa;
StringTokenizer st = new StringTokenizer(s, " +-,/");
String[] sp = new String[st.countTokens()];
int i = 0;
...