Parse string in j2me
String response="making year:2011-01-01 id:1011";
We want to parse this string like 开发者_Python百科below:
t1=making year:2011-01-01;
t2=id:1011;
How can I do this in j2me?
int index = response.indexOf("id:");
if (index != -1)
{
String t1 = response.substring(0,index);
String t2 = response.substring(index);
}
精彩评论