July 2018 - Digital Tool Factory blog

The Digital Tool Factory Blog

How to fix the problem of undeletable characters in json strings in Visual Studio

So – you’re cruising around in web services, pulling data from various sources and your want to deserialize a string into an object, however, you can’t seem to remove extra quotations and escape characters. In fact everything you see looks like this

“{\”DataThingObject\”:{\”DataThingOneID\”:89,\”Status\”:\”Active\”,\”UserId\”:89,

and the \ and ” don’t go away, no matter how much text manipulation you do.

There actually isn’t a problem, you’re just looking at the string in the debugger, which adds the escape charachters for some reason – if you save it to a text or json file you will see that your json files are perfectly formatted.


06
Jul 18


Written By Steve French

 




Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.