假设现在有一个jsonarray字符为:["1","2","3","4","5"]
需要将其拆分为两个jsonarray分别为:["1","2","3"] 和["4","5"]
请大佬为小弟解解惑!万分感谢!
假设现在有一个jsonarray字符为:["1","2","3","4","5"]
需要将其拆分为两个jsonarray分别为:["1","2","3"] 和["4","5"]
请大佬为小弟解解惑!万分感谢!
可以先将此jsonarray转成list集合(循环遍历加入到list当中)-------》再然后用此贴的方法https://blog.csdn.net/u010523770/article/details/54585261,把list拆分为两个list----------》再分别list.get(0)和list.get(1),得到两个list,再list转换成jsonarraylist如同 JSONArray parseArray12 = JSONArray.parseArray(JSON.toJSONString(list1)); 就可以了