/*
* 你只需要将
http://ostermiller.org/utils/StringTokenizer.java.html中的
public class StringTokenizer implements java.util.Enumeration, java.util.Iterator {
简化为
public class StringTokenizer implements java.util.Enumeration{
。
即可立即在midlet中使用
String s = " ( aaa \t * (b+c1 ))";
StringTokenizer st = new StringTokenizer(s, " \t\n\r\f", "()+*");
while (st.hasMoreTokens()) {
System.out.println(st.nextToken());
,我经过实际测试,得到了如下结果:
(
aaa
*
(
b
+
c1
)
)
*/
String s = " ( aaa \t * (b+c1 ))";
StringTokenizer st = new StringTokenizer(s, " \t\n\r\f", "()+*");
while (st.hasMoreTokens()) {
System.out.println(st.nextToken());
* 你只需要将
http://ostermiller.org/utils/StringTokenizer.java.html中的
public class StringTokenizer implements java.util.Enumeration, java.util.Iterator {
简化为
public class StringTokenizer implements java.util.Enumeration{
。
即可立即在midlet中使用
String s = " ( aaa \t * (b+c1 ))";
StringTokenizer st = new StringTokenizer(s, " \t\n\r\f", "()+*");
while (st.hasMoreTokens()) {
System.out.println(st.nextToken());
,我经过实际测试,得到了如下结果:
(
aaa
*
(
b
+
c1
)
)
*/
String s = " ( aaa \t * (b+c1 ))";
StringTokenizer st = new StringTokenizer(s, " \t\n\r\f", "()+*");
while (st.hasMoreTokens()) {
System.out.println(st.nextToken());
StringTokenizer的Ostermiller版本,源代码可以从Ostermiller Utils version 1.05.00 下载。