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