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 - ScrollTo Effect (href to div) -

javascript - ng-class not responding to change in model in Angular? -

javascript - document.registerElement extending HTMLInputElement prototype while using custom tag name to avoid implicit browser style -