I have the following string:
{"data.childData1":"s1","data.childData2":"s2",...}
How do I convert it to:
{"data":{
"childData1":"s1",
"childData2":"s2"
}
}
I have the following string:
{"data.childData1":"s1","data.childData2":"s2",...}
How do I convert it to:
{"data":{
"childData1":"s1",
"childData2":"s2"
}
}
You can use this lib to beautify json, or use Json.NET (example source):
public string GetPrettyPrintedJson(string json)
{
dynamic parsedJson = JsonConvert.DeserializeObject(json);
return JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
}