List of utility methods to do String Tokenize
String[] | tokenize(String s) Tokenize string s into an array ArrayList<String> r = new ArrayList<String>(); String remain = s; int n = 0, pos; remain = remain.trim(); while (remain.length() > 0) { if (remain.startsWith("\"")) { pos = remain.indexOf('"', 1); if (pos == -1) ... |
List | tokenize(String s) tokenize ArrayList<String> list = new ArrayList<String>(); if (s != null) { StringBuilder sb = new StringBuilder(); boolean inQuote = false; final int limit = s.length(); for (int i = 0; i < limit; i++) { char c = s.charAt(i); switch (c) { ... |
String[] | tokenize(String s) tokenize return tokenize(s, null, (char) 0, 0); |
String[] | tokenize(String s) Tokenize string s into an array ArrayList<String> r = new ArrayList<String>(); String remain = s; int n = 0, pos; remain = remain.trim(); while (remain.length() > 0) { if (remain.startsWith("\"")) { pos = remain.indexOf('"', 1); if (pos == -1) ... |
List | tokenize(String s) Splits a given string into tokens separated by ' ' or '_', and according to the Camel case notation. String currentToken = ""; List<String> tokens = new ArrayList<String>(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == ' ' || c == '_') { tokens.add(currentToken); currentToken = ""; continue; ... |
String[] | tokenize(String s, char separator) Split up a string into tokens delimited by the specified separator character. if (s == null || s.length() == 0) { return null; int start = 0; int stop = 0; ArrayList tokens = new ArrayList(); while (start <= s.length()) { stop = s.indexOf(separator, start); ... |
String[] | tokenize(String s, char separator, int maxTokens) Given a string, return an array of tokens. List tokens = new ArrayList(); StringBuilder token = new StringBuilder(); boolean prevIsEscapeChar = false; for (int i = 0; i < s.length(); i += Character.charCount(i)) { int currentChar = s.codePointAt(i); if (prevIsEscapeChar) { token.appendCodePoint(currentChar); prevIsEscapeChar = false; ... |
String[] | tokenize(String s, char separator, int maxTokens) Given a string, return an array of tokens. List tokens = new ArrayList(); StringBuilder token = new StringBuilder(); boolean prevIsEscapeChar = false; for (int i = 0; i < s.length(); i += Character.charCount(i)) { int currentChar = s.codePointAt(i); if (prevIsEscapeChar) { token.appendCodePoint(currentChar); prevIsEscapeChar = false; ... |
String[] | tokenize(String s, String delimiters) Tokenize given string for specified delimiter(s). if (s == null) { return new String[] {}; StringTokenizer tokenizer = new StringTokenizer(s, delimiters); String result[] = new String[tokenizer.countTokens()]; int index = 0; while (tokenizer.hasMoreTokens()) { result[index++] = tokenizer.nextToken(); ... |
ArrayList | tokenize(String s1) tokenize ArrayList<String> fin = new ArrayList(); StringTokenizer st1 = new StringTokenizer(s1); for (; st1.hasMoreTokens();) { fin.add(st1.nextToken()); return fin; |