FlexScript Class - JSON
Description
A class containing common JSON functions.
Static Methods
parse |
Parses a JSON string and returns a Variant. |
stringify |
Converts a Variant into a JSON string. |
Details
Do no remove, this fixes the anchor on doc.flexsim.com
Parameters
Returns
Variant
|
The parsed JSON as a Variant. |
Description
Parses a JSON string and returns a Variant.
Array array = JSON.parse("[0, \"string\"]");
Map map = JSON.parse("{\"number\" : 0, \"string\" : \"string\"}");
Do no remove, this fixes the anchor on doc.flexsim.com
JSON.stringify()
Parameters
Returns
string
|
The resulting JSON string. |
Description
Converts a Variant into a JSON string.
string str1 = JSON.stringify([0, "string"]);
Map map;
map["number"] = 0;
map["string"] = "string";
string str2 = JSON.stringify(map);