Monday 13 August 2018

C# Parse Json string into Array (equivalent of Json.parse in Javascript)

I have following string.



string jsonString = "[['Angelica','Ramos'],['Ashton','Cox']]";



I want to parse it into Javascript array like



[
[

"Angelica",
"Ramos"
],
[
"Ashton",
"Cox"
]
]



similar to Json.parse command. Any idea how to do this with .NET?



I tried both



JsonConvert.DeserializeObject(jsonString)


and



JsonConvert.DeserializeObject>(jsonString)



but no luck so far



UPDATE ANSWER :



Oluwafemi answer is correct, here's the example between Oluwafemi answer and WHOl



enter image description here

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...