Loop through returned JSON from an API

13 views
Skip to first unread message

Dean Rezaei

unread,
Mar 15, 2017, 4:00:36 PM3/15/17
to Collection+JSON

HI, I have the following JSON in asp.net VB:

Dim jsonString As String = "{'results':[ {'comments':  'some text', 'date'   : 'some date', 'user':'aaa'},{'comments':  'some text2', 'date2'   : 'some date2', 'user':'aaa2'}]} "

        Dim json As JObject = JObject.Parse(jsonString)
     
        Dim data As List(Of JToken) = json.Children().Item("results")
        For Each rootObject As JProperty In json.SelectToken("comments")
        Next

How can I loop though the values like comments?

Thank you

Reply all
Reply to author
Forward
0 new messages