Java String Tokenize tokenize(String str, String delims, boolean returnDelims)

Here you can find the source of tokenize(String str, String delims, boolean returnDelims)

Description

tokenize

License

Open Source License

Declaration

public static List<String> tokenize(String str, String delims, boolean returnDelims) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static List<String> tokenize(String str, String delims, boolean returnDelims) {
        List<String> list = new ArrayList<String>();
        if (str != null && str.length() > 0) {
            StringTokenizer tok = (delims == null ? new StringTokenizer(str)
                    : new StringTokenizer(str, delims, returnDelims));
            while (tok.hasMoreTokens()) {
                list.add(tok.nextToken());
            }//from  w w w.j a  v  a2s  .c om
        }
        return list;
    }
}

Related

  1. tokenize(String sentence)
  2. tokenize(String source, char separator)
  3. tokenize(String source, char separator)
  4. tokenize(String str, char delim)
  5. tokenize(String str, String delims)
  6. tokenize(String string, String splitOn)
  7. tokenize(String text)
  8. tokenize(String text)
  9. tokenize(String text)