Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

c# json foreach key value

var dict = JObject.Parse(@"{""1"":""Name 1"",""2"":""Name 2""}");

var dict = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
foreach(var kv in dict)
{
    Console.WriteLine(kv.Key + ":" + kv.Value);
}
 
PREVIOUS NEXT
Tagged: #json #foreach #key
ADD COMMENT
Topic
Name
4+1 =