[Solved] Deserializing Json string c# [closed]


your json is not valid. But if you remove an extra braket at the start and the end of a string

json = json.Substring(1,json.Length-2);

then you can parse it

using Newtonsoft.Json;

var jsonObject = JObject.Parse(json);

int density = (int)jsonObject["density"];
double[] coordinates = jsonObject["geometry"]["coordinates"].ToObject<double[]>();

1

solved Deserializing Json string c# [closed]