导航:首页 > 编程语言 > 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相关的资料

热点内容
怎么查一个网站的外链 浏览:675
linux下db2安装时版本选择 浏览:738
汇编编程用哪个软件 浏览:486
仙乐下的歌在文件管理哪里 浏览:477
115网盘解析工具2014 浏览:371
内圆弧铣刀怎么编程 浏览:410
记事本文件转word格式对齐 浏览:300
excel删除恢复文件 浏览:290
三星s4怎么切换3g网络 浏览:994
什么是网站维护 浏览:314
文件夹录像在哪里 浏览:621
可以发语音的是什么app 浏览:804
恢复手机桌面文件管理 浏览:627
用什么软件可以打开psd文件 浏览:459
公安有哪些警务app 浏览:150
生意转租用什么app 浏览:683
广义的网络信息保密性是指 浏览:657
qq背景唯美简约图片 浏览:292
sky网络电话怎么收费 浏览:599
编程公司哪个比较好 浏览:182

友情链接