I am currently concatenating array elements in a single variable with , between them. I'm getting record like this
abc,def,ghi,
I dont want to add an extra comma ,
after last element. My code is:
{% for driver in item.vehicles if driver.driver.firstName %}
{% set isDriver = 1 %}
{% set driverList = driverList ~ driver.driver.firstName ~ ',' %}
{% endfor %}
Just test for the last loop index