We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StringTokenizer类
前言:StringTokenizer类 和 split() 不同之处在于前者不使用正则表达式做分隔标记
split()
正则表达式
两种构造方法
StringTokenizer(String s) //为s构造一个分析器,使用默认分隔符 StringTokenizer(String s,String delim) //为s构造一个分析器,参数delim的字符的 任意排列 作为分隔标记
我们称StringTokenizer对象是一个字符序列分析器,它封装的数据是若干个单词。所以我们就有两种常见的方法来操作里面的单词
.nextToken(); //返回一个单词,并从分析器里删除它 .hasMoreTokens(); //判断还有没有单词 .countTokens(); //返回当前的单词数
The text was updated successfully, but these errors were encountered:
No branches or pull requests
StringTokenizer类
两种构造方法
StringTokenizer的操作方法
The text was updated successfully, but these errors were encountered: