Just a quick question:
If I have a json object which contains "key/value"s like this:
"name":"value"
and I want to change the name parts to something else, what should I do? I don't want to remove and make it again.
Proper and compact implementation, given that jsonObject
is the json object you are referring to and it is an instance of JSONObject
:
jsonObject.put("new name", jsonObject.remove("name"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With