I have json like this
{
\"name\": \"somenameofevent\",
\"type\": \"event\",
\"data\": {
\"object\": {
\"age\": \"18\",
If you are worried about the overhead because the object is deserialized to a JObject a and then serialized again (solution offered by @fero ) then you can try the following.
Approach 1: Create your own custom JsonConverter and override ReadJson
using(var jsonReader = new JsonTextReader(myTextReader))
{
while(jsonReader.Read()){
if(jsonReader.TokenType.PropertyName=="SomeDesct")
{
//do what you want
}
}
}
For more detail check the link Incremental JSON Parsing in C#
Approach 2: Read the json string and apply string functions or regex function to get the desired string.