jn2string()

jn2string()#

Convert a JSON value to a string. Works with json_t *.

Prototype

PUBLIC const char *jn2string(
    json_t      *jn,
    const char  *default_value
);
        

Parameters

Key

Type

Description

jn

json_t *

The JSON value to convert.

default_value

const char *

The default value to return if the JSON value cannot be converted to a string.


Return Value

Returns the string value, or default_value if the conversion fails.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples