For the complete documentation index, see llms.txt. This page is also available as Markdown.

JSONPrettify

Prettifies a JSON string.

Method Signature

JSONPrettify(var=[string])

Arguments

Argument
Type
Required
Description
Default

var

string

true

The JSON string to prettify.

Examples

Prettify a JSON string

json = '{"name":"Luis","age":42}';
result = jsonPrettify( json );
writeOutput( result.contains( chr(10) ) );

Result: true

Custom indentation

json = '{"a":1,"b":2}';
result = jsonPrettify( json, "  " );
writeOutput( result.contains( "  " ) );

Result: true

Last updated

Was this helpful?