stringToArrayObject

Convert two strings in an array of objects.

1
{{stringToArrayObject [keys] [values] valueDelimiter="|" lineDelimiter="||"}}
Example
format JSON XML
Data JSON
1
2
3
4
5
6
{
"data":{
"keys": "name|price",
"products": "Soda|2.00||Pizza|25.00||Candies|3.50"
}
}
Code
1
2
3
{{#stringToArrayObject data.keys data.products valueDelimiter="|" lineDelimiter="||"}}
<div>Name: {{name}} / Price: {{price}}</div>
{{/stringToArrayObject}}
Result
Data XML
1
2
3
4
<data
keys="name|price"
products="Soda|2.00||Pizza|25.00||Candies|3.50"
/>
HTML
1
2
3
{{#stringToArrayObject data._keys data._products valueDelimiter="|" lineDelimiter="||"}}
<div>Name: {{name}} / Price: {{price}}</div>
{{/stringToArrayObject}}
Result