ExportString¶
The inverse of ImportString: serialises an expression in a given format
and returns the result as a string.
Wolfram supports many named backends ("CSV", "JSON", "PNG", etc.);
Woxi currently implements a subset.
Only machine numbers are written bare; every other value is quoted, and a
compound one that CSV cannot represent becomes a -Head- placeholder:
"String" gives the expression's own text:
A value JSON cannot represent fails the export rather than being approximated:
$ wo 'ExportString[<|"a" -> Pi|>, "JSON"]'
Export::jsonstrictencoding: Expression Pi cannot be exported as JSON.
$Failed
Symbolic XML is written back out as markup:
Elements without children are self-closing, and element-only content is indented one space per level: