String.tokenize()

Signature

String[] tokenize(String str, String delimiter)

Domain

action, condition

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

NameTypeDescription
strStringA String to be tokenized.
delimitersStringThe characters in the delimiters argument are the delimiters for separating tokens. The default is " \\t\\n\\r\\f" if null is passed.

Returns

TypeDescription
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" }