我正在创建一个应用程序,该应用程序应该使用get方法从mySql数据库中读取文本。在J2ME中分割文本
一旦它从数据库中获取数据元素作为字符串,它应该分割字符串并使用字符串创建一个列表,但split()方法在这里似乎不起作用。
J2ME说cannot find method split()
- 我该怎么办?
我的代码如下:
/* assuming the string (String dataString) has already
been read from the database and equals one,two three
i.e String dataString = "one,two,three"; */
String dataArray[];
String delimiter = ",";
dataArray = dataString.split(delimiter);
//continue and create a list from the array.
我已经试过这在台式机和控制台应用程序,似乎完美地工作,但代码不会在J2ME应用程序运行。有没有我应该使用的方法?我能做什么?
看到这个重复的问题:我如何在J2ME分割字符串(http://stackoverflow.com/questions/200746/how-do-i -split串功能于J2ME)。 – 2012-04-12 08:40:12
谢谢你。很感谢 – sammyukavi 2012-04-12 08:55:25