Parsing
parse
This helper converts a STRING into a structured object at runtime.
It supports:
| Input starts with | Parsed as |
|---|---|
< | XML |
{ | JSON object |
[ | JSON array |
JSON example
Result:
Name: Laptop
Price: 1000
JSON array example
Result:
<div>1</div>
<div>2</div>
<div>3</div>
XML example
Result:
Laptop
1000
Parse + Each example
Result:
<li>Laptop</li>
<li>Mouse</li>
<li>Keyboard</li>
Dynamic Parse from Variable
We have this data:
{
"#text": "{\"name\":\"Laptop\",\"price\":1000}"
}
We can use:
Result:
Laptop - 1000