jsonWriteString

Adds a string key-value pair to a JSON object with proper escaping. Takes json string, key string, and value string. Returns modified json via ReturnString.

JSON

Parameters & Returns

Parameters

json String
key String
value String

Returns

String

Quick Summary

Adds a string key-value pair to a JSON object with proper escaping. Takes json string, key string, and value string. Returns modified json via ReturnString.

Technical Exegesis...

Adds a string key-value pair to a JSON object with proper escaping. Takes json string, key string, and value string. Calls NeedsComma to check if comma needed. If comma needed, appends ",". Appends "\"key\":\"escapedValue\"" format. Calls EscapeJSONString to escape special characters: \" -> \\\", \\ -> \\\\, \\b -> \\b, \\f -> \\f, \\n -> \\n, \\r -> \\r, \\t -> \\t. Returns modified json via ReturnString.

This function adds string field to JSON object with proper JSON escaping.

Example

Example.bam
; No example implemented yet