本文介绍了如何将JSON对象转换为字符串中的Android ..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从的JSONObject
<$c$c>{"CNo":80,"CName":"ganesh","CMail":"[email protected]","CMailType":"home","CPhNo":9878987776,"CPhNoType":"home","ClientNo":1}$c$c>
到
<$c$c>{\"CNo\":80,\"CName\":\"ganesh\",\"CMail\":\"[email protected]\",\"CMailType\":\"home\",\"CPhNo\":9878987776,\"CPhNoType\":\"home\",\"ClientNo\":1}$c$c>
推荐答案
我希望这有助于。就在昨天学会了:)
I hope this helps. Just learnt it yesterday :)
JSONObject foo = yourJSONOject;
String uid = foo.get("CNo").isString().toString();
String type = foo.get("CName").isString().toString();
.
. //for each Key field.
我不知道为什么你已经把逃逸的字符串,但你可以叫追加()
键,只要你想它获得OP。
I am not sure why you have put the escapes in the string, but you can call append()
and get the OP as you want it.
这篇关于如何将JSON对象转换为字符串中的Android ..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!