Regex doubts Android (Java) code

Can someone tell me what this regex does?

new StringTokenizer(string,":/.@\\;,+ ");

I could not understand the exact meaning of this Regex, although it looks somehow related to the separation of lines based on special characters?

+3
source share
3 answers

StringTokenizeruses not regular expressions. The second parameter is a list of characters that will be used as separators between tokens.

The JavaDoc says:

StringTokenizeris an inherited class that is retained for compatibility reasons, although its use is not recommended in new code. It is recommended that anyone looking for this functionality use thesplit String or methodjava.util.regex .

+6

StringTokenizer . - , .

+1

There are no regular expressions in this code. the second argument contains a list of delimiters used to tokenize the string.

0
source

All Articles