导航:首页 > 编程语言 > stringtokenizerjava

stringtokenizerjava

发布时间:2025-03-04 22:25:06

① 在java中什么意思public class stringtokenizer implements enumeration

定义一个叫stringtokenizer的类,并使它实现enumeration接口。

② java中的StringTokenizer怎么用

API文档中,就有例子

A token is returned by taking a substring of the string that was used to create the StringTokenizer object.

The following is one example of the use of the tokenizer. The code:

StringTokenizer st = new StringTokenizer("this is a test");
while (st.hasMoreTokens()) {
System.out.println(st.nextToken());
}

prints the following output:

this
is
a
test

StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead.

The following example illustrates how the String.split method can be used to break up a string into its basic tokens:

String[] result = "this is a test".split("\\s");
for (int x=0; x<result.length; x++)
System.out.println(result[x]);

prints the following output:

this
is
a
test

Since:
JDK1.0
See Also:
StreamTokenizer

阅读全文

与stringtokenizerjava相关的资料

热点内容
imagetest教程 浏览:244
怎样将一个cad文件包图纸兼容 浏览:898
论文有什么好的网站 浏览:581
jdk7javadoc 浏览:687
编程小游戏是如何设计的 浏览:913
网络安全风险案例 浏览:46
司法考试哪个网站好 浏览:469
android搜索功能代码 浏览:437
文件名如何没有文字 浏览:601
吃鸡地图资源包文件路径 浏览:267
cad文件转移手机 浏览:733
指定局域网内文件delphi 浏览:638
苹果5s充电接口维修 浏览:913
建行app怎么老是信息填写错误 浏览:832
罗技g903切换配置文件 浏览:649
游戏的数据在哪个英文文件夹 浏览:435
编程一般学什么专业课 浏览:394
不属于数据库系统的主要组成部分 浏览:797
jdl是什么网络词 浏览:247
优酷的缓存视频文件夹 浏览:842

友情链接