Sorry if some one ask this question earlier but I am unable to find relatively.
My query is
String like this -> {"value":123,"key":abc};
Change into =>
String str = ['"','v','a','l','u','e',':','1','2','3',',','k','e','y',':','a','b','c','"']; // char array
str[0] will be " , str[1] will be v
So I want to know whether it is possible if i want to fetch value by this. let's say
str.getString("value") = 123 <- output expecting
things i tried:
1. JSONObject newStr = (JSONObject)JsonSerializer.toJSON(str);
2. Str.contains("key")
3. JSONObject newStr = new JSONObject(str);
but nothing work for me. Can any one help me with that.
Is there any way so that i can get this answer like this.
str.get("value") = 123 and str.get("key") = abc