Java Utililty Methods String Split by Word

List of utility methods to do String Split by Word

Description

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

Method

Listsplit(String words, String character)
Splits this string around matches of the given character
if (words == null) {
    return new ArrayList<String>();
if (words.length() == 0) {
    return new ArrayList<String>();
String[] arrays = words.split(character);
return Arrays.asList(arrays);
...
String[]splitIdentifierToWords(String str)
Splits indentifier into words
str = insertDelimitersIntoCamelStyleNotation(str, '_');
return str.split("_");
ListsplitIntoWords(String s)
splits the input string into words e.g.
List<String> result = new ArrayList<String>();
if (s == null)
    return result;
StringTokenizer st = new StringTokenizer(s);
while (st.hasMoreTokens()) {
    String term = st.nextToken();
    if (term.startsWith("\"")) {
        term = term.substring(1); 
...
ListsplitKeyWords(String sql)
split Key Words
List<String> kws = new ArrayList<String>();
StringBuffer word = new StringBuffer();
for (int i = 0; i < sql.length(); i++) {
    char c = sql.charAt(i);
    if (c == ' ' || c == '\t' || c == '\r' || c == '\n') {
        if (word.length() > 0) {
            kws.add(word.toString().toUpperCase());
            word.delete(0, word.length());
...
ListsplitOne(String wordString)
split One
return Arrays.asList(wordString.split("#"));
String[]splitUnit(String word)
split Unit
List<String> list = new ArrayList<>();
int startIndex = 0, count = 0;
for (int i = 0; i < word.length(); i++) {
    if (word.charAt(i) == '[') {
        if (count == 0) {
            startIndex = i;
        count++;
...
voidsplitWord(List words, int listIndex)
split Word
String word = words.get(listIndex);
if (word.length() <= 1) {
    return;
int index = listIndex + 1;
StringBuffer sword = new StringBuffer(word);
int first = 0;
char firstChar = sword.charAt(first);
...
ListsplitWords(String name)
split Words
name = name.replaceAll("_{2,}", "_");
name = name.replaceAll("-{2,}", "-");
List<String> result = new ArrayList<>();
StringBuilder currentWord = new StringBuilder(name.length());
for (int i = 0, len = name.length(); i < len; i++) {
    char c = name.charAt(i);
    char next = i == len - 1 ? '\0' : name.charAt(i + 1);
    char prev = i == 0 ? '\0' : name.charAt(i - 1);
...
String[]splitwords(String s)
Split a string into words separated by whitespace SPACE | TAB | NEWLINE | CR Citation chars '"' may be used to group words with embedded whitespace.
return splitwords(s, " \t\n\r", '"');
String[]splitwords(String text)
splitwords
ArrayList<String> words = new ArrayList<String>();
StringBuilder buf = new StringBuilder();
String st = "ws";
int i = 0;
while (i < text.length()) {
    char c = text.charAt(i);
    if (st == "ws") {
        if (!Character.isWhitespace(c))
...