I'm stuck on a issue where i get a string from a web request containing html, but inside that html is a json object that i need to parse over to a object to use in my code but i'm stuck on how to do this.
I tried to use IndexOf() and LastIndexOf() but when i try to point them to the first and last curly braces i get a index of -1 and a exception.
Any ideas?
EDIT: I have also tried to convert it to a list of characters and illitterate over it but when it got converted the curly braces were gone and the position was a empty entry.
EDIT2:
Added the html i get from the request, its lines 3-5 that i need to extract.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<body onload="parent.postMessage('redirectResponse=
{"messageId":"4232450191","errorCode":0,"sessionToken":
{"sessionToken":"tRabFfRPwYX4fGdHZOrBYDAAoICwwCDo","issuerSystemId":"380","creationTime":
{"timestamp":"2016-02-11T08:58:30.000+00:00"},"expirationTime":
{"timestamp":"2016-02-11T09:03:30.000+00:00"},"maxIdlePeriod":0},
"realMode":1,"username":"myUserName"}
', 'https://target.site.com');"></body></html>