YAML
ParseString
parse a string containing YAML data
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
ParseString(yamlString, opts)
yamlString
-
string; YAML data
opts
(optional) options as specified below
output=name
either table, record, or DataSeries. Specifies the data structure to use for parsed data corresponding to YAML objects (collections of key/value pairs). With output=table (the default), an object is encoded as table; with output=record, it is encoded as a record; with output=DataSeries, it is encoded as a DataSeries.
The ParseString(yamlString) command parses the input string yamlString, which is assumed to be valid YAML.
Parse an input string to a Maple table
with(YAML):
data := ParseString("[{\"fruit\": \"orange\", \"count\": 23}]");
table⁡fruit=orange,count=23
data[1]["fruit"];
orange
Parse the same input string to a Maple record
dataRec := ParseString("[{\"fruit\": \"orange\", \"count\": 23}]",output=record);
Recordpacked⁡fruit=orange,count=23
The YAML[ParseString] command was introduced in Maple 2017.
For more information on Maple 2017 changes, see Updates in Maple 2017.
See Also
YAML[ParseFile]
YAML[ToString]
Download Help Document
What kind of issue would you like to report? (Optional)