首页 > 编程知识 正文

JAVA String转数组Json转数组,json数据转数组

时间:2023-05-03 20:23:19 阅读:180721 作者:4611

json格式{ ' value ' : [ ' 3d 55 f2a 141 e 84394 ab F6 e 98 B9 de 8f 8f a ' ] }

importorg.JSON.simple.JSON array; importorg.JSON.simple.JSON object; importorg.JSON.simple.parser.JSON parser; importorg.JSON.simple.parser.parse exception; string content=flowformmodel.get content (; JSONobject=(JSONobject ) (new JSONParser ) ).parse(content ); Jonobject.foreach () k,v )-{JSONarrayJSONarray=) JSONarray ) v; for(intj=0; j jsonArray.size (; j () /模板的idstringvalue=JSONArray.get(j ).toString ); idlist.add(value; //关联idmap.put(list )、idList; ); map.put(withRole ),withrole ); Java字符串转换rydj

import org.json.JSONArray; JSONArray param; param=newJSONArray(withrole ); string [ ] withrolearr=new string [ param.length (); //关联模板的id集合for(intI=0; i withRoleArr.length; I ) {withrolearr[I]=param.get(I ).toString ); withrolelist.add (withrolearr [ I ]; () ) ) ) )。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。