1.StringTokenizer (String tag)
StringTokenizer implements an enumeration (enumeration) interface. Therefore, given an input string, you can use StringTokenizer to enumerate the individual tags contained therein. When you use StringTokenizer, you specify an input string and a string that contains a separator. The separator (delimiters) is the character of the split tag. Each character in the delimiter string is treated as a valid separator
The StringTokenizer constructor is as follows: StringTokenizer (String str) StringTokenizer (string str, string delimiters) StringTokenizer ( String str, string delimiters, Boolean Delimastoken) in the above three forms, str represents the string to be tagged. In the first form, the default separator is used. In the second and third forms, delimiters is a string used to specify the delimiter. In the third form, if Delimastoken is true, the delimiter is also returned as a token when the string is parsed, otherwise the delimiter is not returned. In the first and second forms, the separator is not returned as a marker. Once the StringTokenizer object has been created, the NextToken () method is used to extract successive tokens. The Hasmoretokens () method returns True when there are more tokens being extracted. Because StringTokenizer implements enumerations (enumeration), the hasMoreElements () and Nextelement () methods are also implemented, and their role is also different from Hasmoretokens () Same as the Nexttoken () method
java-Basics (v) More tools set