Jinja2 Split string by white spaces

Viewed 45438

I'm using Jinja2 template engine (+pelican).

I have a string saying "a 1", and I am looking for a way to split that string in two by using the white-space as the delimiter.

So the end result I'm looking for is a variable which holds the two values in a form of an array. e.g. str[0] evaluates to "a" & str[1] evaluates to "1".

Thanks in advance.

6 Answers
Related