v9.10.0
Convert values to string via JSON.stringify()
, for debug purpose.
Input
{% assign arr = "foo bar coo" | split: " " %}
{{ arr | json }}
Output
["foo","bar","coo"]
Space
v10.11.0
An additional space
parameter can be specified to format the JSON.
Input
{% assign arr = "foo bar coo" | split: " " %}
{{ arr | json: 4 }}
Output
[
"foo",
"bar",
"coo"
]