C
C#2mo ago
rcnespoli

JSON deserialize

I'm receiving from API a "json" string that have double quotes in value, something like this
var response = "{"details": "This is the "result" of the details"}"
var response = "{"details": "This is the "result" of the details"}"
Is there a way that can I deserialize to an object?
8 Replies
Jimmacle
Jimmacle2mo ago
try to preprocess it to fix it maybe? it's not valid json
TheRanger
TheRanger2mo ago
ur receiving this exact line from the API?
rcnespoli
rcnespoli2mo ago
yes of course I just omit the real value but it's the same structure
TheRanger
TheRanger2mo ago
No i was talking about the var response = part, do you crop it out?
rcnespoli
rcnespoli2mo ago
yes
TheRanger
TheRanger2mo ago
all i can think of that the solution to this is to use regex replace method to fix your json
rcnespoli
rcnespoli2mo ago
it's will be hard But I will try
TheRanger
TheRanger2mo ago
regex gets easier when you get used to it
Want results from more Discord servers?
Add your server
More Posts