C
C#8mo 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
Jimmacle8mo ago
try to preprocess it to fix it maybe? it's not valid json
TheRanger
TheRanger8mo ago
ur receiving this exact line from the API?
rcnespoli
rcnespoliOP8mo ago
yes of course I just omit the real value but it's the same structure
TheRanger
TheRanger8mo ago
No i was talking about the var response = part, do you crop it out?
rcnespoli
rcnespoliOP8mo ago
yes
TheRanger
TheRanger8mo ago
all i can think of that the solution to this is to use regex replace method to fix your json
rcnespoli
rcnespoliOP8mo ago
it's will be hard But I will try
TheRanger
TheRanger8mo ago
regex gets easier when you get used to it
Want results from more Discord servers?
Add your server