List of utility methods to do String Split
String[] | stringSplit(String s) string Split List<String> f = new ArrayList<>(); int p = 0; for (int i = 0; i < s.length(); i++) { if (s.charAt(i) == ' ') { f.add(s.substring(p, i)); p = i + 1; while (i < s.length() - 1 && s.charAt(i + 1) == ' ') { i++; ... |
String[] | stringSplit(String string, String tokens, boolean trimStrings) string Split if (string == null) return (null); if (string.length() == 0) return (new String[0]); Vector res = new Vector(); StringTokenizer stk = new StringTokenizer(string, tokens, false); while (stk.hasMoreTokens()) res.addElement(stk.nextToken()); ... |
List | stringSplitter(String string) Return a List with all words in a given String String[] words = string.split(" "); return Arrays.asList(words); |