[json-lib-user] Remove name value pair from JSONObject
Brought to you by:
aalmiray
From: Haritha J. <har...@ya...> - 2007-12-07 00:22:33
|
Hi Everyone, I am using JSON-LIB to serialize json to java objects. I have a java object ImageBean.When i do a JSONObject.fromObject( imgBean ) the output is {"sizeWidth":940,"style":"width:940px;","name":"","css":""} I am trying to remove width:940px name-value pair from this JSONObject by using this code snippet JSONObject.fromObject( imgBean ).remove("width"); When i print the JSONObject invoking remove() i get "940px" as the output. Is there a way to remove a name-value pair from the JSONObject and get the final output as {"sizeWidth":940,"name":"","css":""} Cheers Haritha ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ |