我想从JSONObject
转换{"CNo":80,"CName":"ganesh","CMail":"[email protected]","CMailType":"home","CPhNo":9878987776,"CPhNoType":"home","ClientNo":1}
至{\"CNo\":80,\"CName\":\"ganesh\",\"CMail\":\"[email protected]\",\"CMailType\":\"home\",\"CPhNo\":9878987776,\"CPhNoType\":\"home\",\"ClientNo\":1}
最佳答案
我希望这有帮助。昨天才刚学到的:)
JSONObject foo = yourJSONOject;
String uid = foo.get("CNo").isString().toString();
String type = foo.get("CName").isString().toString();
.
. //for each Key field.
我不确定为什么要将转义符放在字符串中,但是可以调用
append()
并根据需要获取OP。关于android - 如何将json对象转换为android中的字符串?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4049582/