如何在J2ME分割字符串? [英] How do I split strings in J2ME?

查看:118
本文介绍了如何在J2ME分割字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何分割字符串?

有一个<一个href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/StringTokenizer.html"><$c$c>StringTokenizer或<一href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html#split%28java.lang.String%29"><$c$c>String.split(String正则表达式) 在标准版(J2SE),但他们没有在微型版(J2ME,MIDP)。

There is a StringTokenizer or String.split(String regex) in the standard edition (J2SE), but they are absent in the micro edition (J2ME, MIDP).

推荐答案

有一个StringTokenizer类的J2ME的几个实现。这一次由 Ostermiller 将最有可能包括你需要的功能

There are a few implementations of a StringTokenizer class for J2ME. This one by Ostermiller will most likely include the functionality you need

另请参阅此页面上移动编程进站一些修改和下面的例子:

See also this page on Mobile Programming Pit Stop for some modifications and the following example:

String firstToken;
StringTokenizer tok;

tok = new StringTokenizer("some|random|data","|");
firstToken= tok.nextToken();

这篇关于如何在J2ME分割字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆