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

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -