K
K
Kirill Legend2020-02-13 15:21:53
C++ / C#
Kirill Legend, 2020-02-13 15:21:53

How to find out if a field exists in JSON?

How to find out if a field exists in JSON? In c# via JObject.

if (jObject["updates"][0]["type"].ToString() == "message_new")
{
}

The response returns an Updates[] field, and it may or may not contain a message.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question