I have an integer value, say int id
whose value i get runtime by getter function.
I want to replace this value of id
in place of "VALUE"
from .json like as follows
{
"id":"VALUE",
"name": "Name updated",
"description": "description Updated",
"active": false
}
I found following way to replace it if id
is String
,
String str = "myJson.json";
str.replace("\"VALUE\"", "\"id\"");
How can i use int id in above function with this format "\"id\"" ? Any other solution are welcome.
EDIT:
String str = "myJson.json";
is wrong way to get json content into String.