String.parse_json
String.parse_json
Function
Parse the current JSON string into BT values.
Syntax
string.parse_json()
Parameters
No parameters.
Return value
| Type | Description |
|---|---|
| Any/Null | The corresponding BT value is returned if the parsing is successful; Null is returned if the parsing fails. |
Example
result = '{"name":"BT"}'.parse_json() // Output: BT echo(result.name)
Notes
- JSON objects are converted to BT Object and arrays are converted to BT Array.
- The original string will not be modified.