Quantcast
Channel: Discarding garbage characters after json object with Json.Net - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Discarding garbage characters after json object with Json.Net

$
0
0

I have to consume a so called web service implemented by a dumb monkey which is returning some garbage after the proper Json response.Something like this:

{"Property1": 1,"Property2": 2,"Property3": 3}<?xml version='1.0' ?>Maybe some other gibberish nonsense I wish to discard.

Now, I could just search for "<?xml" and split, but I was wondering if I can use a stream reader or something to read up to the closing } and then discard the rest.

I'm using C# and Json.Net.


Viewing all articles
Browse latest Browse all 3

Trending Articles