更新时间:2023-01-17 07:37:20
正确而紧凑的实现,假设 jsonObject
是您引用的json对象,它是 JSONObject
的实例:
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"));