json - C# JsonArray to string (not string array. string only) -


i've been searching 1 quite while can't find anything. appologies title, there lot on converting content string arrays, not need.

i need way convert contents of jsonarray string is. (similar jtoken's .tostring()). scenario of such nature need string of array is, irrigardless of type/s contained within. there ways of handling weakly typed json valueconverters, spesifically not want use them, need pass content of field string javascript function in webview.

i have following json (note markers indicating string desired) :

"highlights2":[   {     "_id":"highlight2-2850cb68121f9d4093e67950665c45fab02cec81",     "_rev":"9-c4345794001495104f8cbf5dd6999f3a",     "content":{             <---- need string       "#roepman.17.0":[         [           233,           249,           "itsi-hl-gr"         ],         [           298,           317,           "itsi-hl-bl"         ]       ],       "#roepman.19.0":[         [           5,           7,           "itsi-hl-gr"         ]       ]     },                  <----- here     "created":1434552587   }, //...more  ], "book":"book-930d62a2-9b7c-46a9-b092-f90469206900", "servertime":1435151280 

ideally want parse list of following type:

public class highlightinfo2 {     public string _id { get; set; }     public string _rev { get; set; }}     public string content { get; set; }     public long created { get; set; } } 

however not possible, content of "content" of type jsonarray. past not having specify type "content", use this:

public class highlightinfo2 {     public string _id { get; set; }     public string _rev { get; set; }}     public dictionary<string, list<jsonarray>> content { get; set; }     public long created { get; set; } } 

but means still have @ point convert list< jsonarray > inside dictionary string pass content of "content" javascript function in webview later on.

any way of converting jsonarray string?

based on comment, formatting of string irrelevant. has valid json representing original data.

what suggest make content member in highlightinfo2 of type object , simple perform jsonconvert.serializeobject(highlightinfo.content) json string. can pass on javascript function.

if need often, can combine behzad's answer , add member class stores converted value.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -