API Interpretation: StringTokenizer

xiaoxiao2021-03-06  94

StringTokenizer is a SPLIT function that is used to separate the String application class, which is equivalent to the split function of VB.

Constructor

Public StringTokenizer (String STR)

Public StringTokenizer (String Str, String Delim)

Public StringTokenizer (String Str, String Delim, Boolean Returndelims)

The first parameter is the string to be separated, the second is the separation character set, the third parameter indicates whether the separator is returned as a mark, and if the divider is not specified, the default is: "/ t / n / r / f"

2. Core method

Public Boolean HasmoreToKens ()

Public String NextTtoken ()

Public String NextToken (String Delim)

Public int countToKens ()

In fact, it is three ways to return to the divider block, or the split can be specified, and it is used in the last specified separator.

3. Excess method

Public Boolean HasmoreElements ()

Public Boolean HasmoreElements ()

This class implements the Enumeration interface, so there are more than two ways, in fact, there is no need to implement this interface.

Its name is called StringTokenizer, and there is nothing to return to an Object.

转载请注明原文地址:https://www.9cbs.com/read-105722.html

New Post(0)