arrayToString

Convert an array of data to a string.

1
2
3
4
{{#arrayToString [array] valueDelimiter="|" lineDelimiter="||" path="deep.data"}}
{{keys}}
{{values}}
{{/arrayToString}}
Example
format JSON XML
Data JSON
1
2
3
4
5
6
7
8
{
"Colors": [
{"name": "aqua", "hex": "#76eec6"},
{"name": "cyan", "hex": "#00ffff"},
{"name": "orange", "hex": "#ff8c00"},
{"name": "violet", "hex": "#9400d3"}
]
}
Code
1
2
3
4
{{#arrayToString Colors valueDelimiter="|" lineDelimiter="||"}}
<div>{{keys}}</div>
<div>{{values}}</div>
{{/arrayToString}}
Result
Data XML
1
2
3
4
5
6
<Colors>
<color name="aqua" hex="#76eec6"></color>
<color name="cyan" hex="#00ffff"></color>
<color name="orange" hex="#ff8c00"></color>
<color name="violet" hex="#9400d3"></color>
</Colors>
HTML
1
2
3
4
{{#arrayToString Colors.color valueDelimiter="|" lineDelimiter="||"}}
<div>{{keys}}</div>
<div>{{values}}</div>
{{/arrayToString}}
Result