Method similar to ‘startswith’ in Jinja2/Flask
A better solution…. You can use startswith directly in field because field is a python String. {% if field.startswith(‘i-‘) %} More, you can use any String function, including str.endswith(), for example.