1

I want to deserialize a JSON string that has double quoted string as mentioned below.

Json:

string jsonString = "{\"Name\": 2, \"Description\": \"The \"test\" description\"}";

Target Class:

public class TestClass
{
    public string Name { get; set; }
    public string Description { get; set; }
}

Deserialization Code:

string jsonString = "{\"Name\": 2, \"Description\": \"The \"test\" description\"}";
var jData = JsonConvert.DeserializeObject<TestClass>(jsonString);

I am not able to escape the double quotes and having the following error.

enter image description here

Chris.ZA
  • 1,218
  • 1
  • 15
  • 30
Anadi
  • 744
  • 9
  • 24

0 Answers0