String.tokenize()
Signature
String[] tokenize(String str, String delimiter)
Description
Breaks an input string into tokens, returning a string tokens in a String[].
The whole delimiters input string is not a single "delimiter".
Parameters
Name | Type | Description |
str | String | A String to be tokenized. |
delimiters | String | The characters in the delimiters argument are the delimiters for separating tokens.
The default is " \\t\\n\\r\\f" if null is passed. |
Returns
Type | Description |
String[] | All tokens in a String[]. |
Cautions
The whole delimiters input string is not a single "delimiter"
Example
String[] result = String.tokenize("This is a test", null);
Result is:
result = {"This", "is", "a", "test" }