Escjson

This function adds the back slash () character in a string of character to circumvent the ones that cannot be present in a JSON constant (", \, tab, or CR).

Syntax

 DEST_STRING=escjson(SOURCE_STRING)

Examples

Local Char MYCONSTANT(100),JSONCONSTANT(100)MYCONSTANT='This is an "example" with back\slashes'JSONCONSTANT='"myconstant" : "'+escjson(MYCONSTANT)+'"'# Now JSONCONSTANT contains '"myconstant" : "This is an \\"example\\" with back\\\\slashes"'

See also

unescjson