ztcl::json string
Writes a JSON string.
ztcl::json string S
Description
Gives S as a JSON string in quotes, with the escapes that JSON needs, such as \" for a quote.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| S | string | required | The text. |
Returns
The JSON text.
Examples
Each example of this page runs after package require ztcl::json.
% ztcl::json string "a\"b"
"a\"b"
Errors
% ztcl::json string
wrong # args: should be "ztcl::json string s"
-errorcode TCL WRONGARGS
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztcl 1.0.0-beta.1