Skip to content

JSON_FROM_STRING

Jurek Muszyński edited this page Sep 11, 2018 · 4 revisions

bool JSON_FROM_STRING(JSON json, const char *src)

Description

Converts string src to JSON object.

Returns

If there was a syntax error it returns false, otherwise true.

Example

char str[]="{\"name\":\"John Smith\",\"age\":35,\"married\":true}";

JSON json={0};

if ( JSON_FROM_STRING(json, str) )
    OUT("str is in JSON");
else
    OUT("str is not a valid JSON");
Clone this wiki locally