开发者

how to split a string of data into different list views?

开发者 https://www.devze.com 2023-04-11 02:34 出处:网络
Would I be able to split a string of data starting with <NewData> with several different objects inside such as <Schedule> ending in </Schedule> and then ending over all with a </

Would I be able to split a string of data starting with <NewData> with several different objects inside such as <Schedule> ending in </Schedule> and then ending over all with a </NewData>开发者_如何学编程. Split that into several list views each schedule in a different list view? quite difficult to explain so any thing I've missed just say...


Umm I'll only give you a hint,

 String stuff = "<Schedule> save kittens </Schedule> " +
                             "<Schedule> and puppies </Schedule>" ;

 String [] result = stuff.split("<Schedule>");
 for(int i = 0; i < result.length; i++)
 {
          if(result[i].length() > 0)
            Log.d("TODO", " - " + result[i].substring(0, result[i].indexOf("<")));
 }
0

精彩评论

暂无评论...
验证码 换一张
取 消