我在android中有一个字符串。
str = |test1:23|st1:4|st2:3|st3:5|test2:25|st1:5|st2:6|st3:7|test3:26|st1:5|st2:2|st3:8|test4:28|st1:8|st2:3|st3:2|test5:29|st1:1|st2:2|st3:2|......
I need to split that string and set each data to listview in android.
I mean for each listitem I should keep the data as
test1:23
st1:4
st2:3
st3:5
---------------------
test2:25
st1:5
st2:6
st3:7
----------------------
现在我将用 | 分割字符串 符号使用:
String splitstring = str.split("\\|");
现在splitstring[0]
包含test1:23
,splitstring[1]
包含sty:4
。但我需要将前 4 个设置为第一个列表项,接下来的四个设置为下一个列表项,依此类推。请建议我如何完成该任务?提前致谢。