String concatenation in Jinja

后端 未结 5 451
旧时难觅i
旧时难觅i 2021-02-03 16:52

I just want to loop through an existing list and make a comma delimited string out of it.
Something like this: my_string = \'stuff, stuff, stuff, stuff\'

<
5条回答
  •  余生分开走
    2021-02-03 17:38

    If stuffs is a list of strings, just this would work:

    {{ stuffs|join(", ") }}
    

    Link to join filter documentation, link to filters in general documentation.

提交回复
热议问题