Java Utililty Methods String Tokenize

List of utility methods to do String Tokenize

Description

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

Method

StringgetParamString(StringTokenizer s)

Gets an String from param file, skiping "="

String contenido = "";
String val = s.nextToken(); 
do {
    if (!s.hasMoreTokens())
        break;
    contenido += s.nextToken() + " ";
} while (true);
contenido = contenido.trim();
...
ArrayListgetSQLTokens(String query)
Returns a list of Strings representing the terms in the search string.
String[] tokens = query.split("#(?:\"([^\"]+)\")|([^ ]+)#");
String noteTokens = "";
for (String token : tokens)
    noteTokens += "\"" + token + "\" ";
ArrayList<String> sqlTokens = new ArrayList<String>();
int numTokens = tokens.length;
for (int i = 0; i < numTokens; i++) {
    String quotesRemovedString = tokens[i].replaceAll("\"", "");
...
String[]getStringTokens(String str)
get String Tokens
if (str.indexOf("\\,") < 0) 
    return str.split(","); 
ArrayList<String> list = new ArrayList<String>();
char[] charArray = (str + ",").toCharArray(); 
int startIndex = 0;
for (int i = 0; i < charArray.length; i++) {
...
String[]getTokenArray(String sequence, String[] chain, boolean paired, boolean includeDelim)
get Token Array
return (String[]) tokenize(sequence, chain, paired, includeDelim).toArray(new String[0]);
ArrayListgetTokens(final String s)
get Tokens
ArrayList<String> tokens = new ArrayList<String>();
int ix1 = 0;
int ix2 = -1;
int len = s.length();
while (ix1 < len && (ix2 = s.indexOf('\n', ix1)) != -1) {
    String token = s.substring(ix1, ix2 + 1);
    tokens.add(token);
    ix1 = ix2 + 1;
...
String[]getTokens(String msg, String delim)
get Tokens
return getTokens(msg, delim, false);
String[]getTokens(String str, String delim)
Break string into an array of tokens.
Vector<String> tokens = new Vector<String>();
StringTokenizer tokenizer = new StringTokenizer(str, delim);
while (tokenizer.hasMoreTokens()) {
    tokens.addElement(tokenizer.nextToken());
String[] returnTokens = new String[tokens.size()];
tokens.copyInto(returnTokens);
return returnTokens;
...
ListgetTokens(String str, String delimiter)
Return the tokens in a string in a list.
ArrayList<String> l = new ArrayList<String>();
StringTokenizer tokens = new StringTokenizer(str, delimiter);
while (tokens.hasMoreTokens()) {
    l.add(tokens.nextToken());
return l;
ListgetTokens(String string)
Returns a list of tokens based on the given string.
if (string == null) {
    return null;
return new ArrayList<>(Arrays.asList(string.split("\\s")));
String[]getTokens(String string)
Parse a string into tokens where whitespace is the delimiter.
return getTokens(string, " \t");