Java String Tokenize tokenize(String string, String splitOn)

Here you can find the source of tokenize(String string, String splitOn)

Description

Tokenize the passed in string.

License

Apache License

Parameter

Parameter Description
string string to tokenize
splitOn string to split the string on.

Return

an array of String tokens.

Declaration

public static String[] tokenize(String string, String splitOn) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /** Tokenize the passed in string.
     *// w w  w .ja  v a 2 s.com
     * @param string string to tokenize
     * @param splitOn string to split the string on.
     * @return an array of String tokens.
     */
    public static String[] tokenize(String string, String splitOn) {
        return string.replace(" ", "").split(splitOn);
    }
}

Related

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