Reputation: 2442
I need to convert a string acbdefrg
into an array of individual letters [a,b,c,d,e,f,r,g]
. I understand how it's done in python through list(your_string)
.
Hoever this code does not work in jinja2. Is this possible, or will I have to make the array in python and pass it over to jinja?
Upvotes: 0
Views: 736
Reputation: 860
If you mean to just iterate through the string, you can explicitly make the array in python and pass it into jinja.
Try to minimise logic in jinja as much as possible.
Upvotes: 1