问题描述
{"287":"高白瓷","1085":"传统工艺","100000729":"是","2176":"中国龙瓷","352":"ZGB0003","1835":"摆件","100018425":"瓷","7980":"雕刻","7201":"人物神像","100018599":"摆饰","7547":"纯手工","346":"福建德化","973":"现代艺术","3426":"人物","21292":"锦盒包装","1498":"可以","446":"23x20x18","1459":"件","8021":"13200","100020186":"1","4341":"1,,13200.00;","3939":"1","1150":"100"}如何取到“ZGB0003”这串字符?
解决方案
解决方案二:
看这内容,应该是json的格式,直接用json的解析器解析一下不就好了?
解决方案三:
引用1楼skgary的回复:
看这内容,应该是json的格式,直接用json的解析器解析一下不就好了?
怎么解析阿,解析不出来阿
解决方案四:
Stringstr=....JSONObjectjobj=newJSONObject(str);jobj.getString("ZGB0003");
解决方案五:
可以用JSON解析,和楼上一样,百度有例子
解决方案六:
1.转换成toString.2.indexof("ZGB0003");3.如果2返回结果!=-1subString截取。
解决方案七:
看错了,不好意思{"287":"高白瓷","1085":"传统工艺","100000729":"是","2176":"中国龙瓷","352":"ZGB0003","1835":"摆件","100018425":"瓷","7980":"雕刻","7201":"人物神像","100018599":"摆饰","7547":"纯手工","346":"福建德化","973":"现代艺术","3426":"人物","21292":"锦盒包装","1498":"可以","446":"23x20x18","1459":"件","8021":"13200","100020186":"1","4341":"1,,13200.00;","3939":"1","1150":"100"}你这返回的是什么类型?
解决方案八:
json类型的数据。3L正解
解决方案九:
先给项目导入json相关的jar报,网上搜下就可importnet.sf.json.JSONObject;publicclassJsonProject{publicstaticvoidmain(String[]args){Stringstr="{"287":"高白瓷","1085":"传统工艺","100000729":"是","2176":"中国龙瓷","352":"ZGB0003"}";JSONObjectjobj=JSONObject.fromObject(str);System.out.println(jobj.get("352").toString());}}
结果:ZGB0003另外,你的json格式有问题,自己整理下