Re: [json-lib-user] Remove name value pair from JSONObject
Brought to you by:
aalmiray
From: Andres A. <aal...@ya...> - 2007-12-10 01:19:12
|
FYI, I've added a discard() method to JSONArray/JSONObject that allows chaining as element() and accumulate() do. Cheers, Andres ----- Original Message ---- From: Haritha Juturu <har...@ya...> To: jso...@li... Sent: Thursday, December 6, 2007 4:22:22 PM Subject: [json-lib-user] Remove name value pair from JSONObject 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 Looking for last minute shopping deals? Find them fast with Yahoo! Search. ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs |