c# - Splitting a part of a JSON string to deserialize -


i have json string don't want deserialize. want deserialize content within' json string.

this how string can like:

"{\"content\":{\"token\":\"*************************\",\"is_verified\":1,\"account_id\":45087,\"is_starter\":0,\"days_left\":1},\"status\":200,\"id\":\"test\",\"method\":\"accounts_login\"}" 

i need content object. need make regex(?) can make string into:

"{\"token\":\"*************************\",\"is_verified\":1,\"account_id\":45087,\"is_starter\":0,\"days_left\":1}" 

what best way this?

you can newtonsoft.json simple as

var json = "{\'content\':{\'token\':\'*************************\',\'is_verified\':1,\'account_id\':45087,\'is_starter\':0,\'days_left\':1},\'status\':200,\'id\':\'test\',\'method\':\'accounts_login\'}";  var jtoken = jtoken.parse(json); var contenttoken = jtoken["content"]; //this selects json-node var content = contenttoken.toobject<yourcontentclass>(); 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -