java - Refining the parsed json data -
a part of json recieved - "value":["14.1\""]
. on using command - string = string.valueof(o.get("value"));
i'm able extract whatever's in value field comes along square brackets, double quotes , slash in between. how retrieve data without square brackets, slash , double quotes?
are sure json in format? value jsonarray
jsonobject object = new jsonobject(s); jsonarray valuearr = object.getjsonarray("value"); string result =string.valueof(valuearr.get(0)); //you'll : 14.1" result = result.replace("\"","") // final: 14.1
Comments
Post a Comment