Jinja2

From PedrosBrainDump
Revision as of 03:15, 10 November 2024 by 413vhcu1lq0463ob (talk | contribs) (Created page with "== Check a pattern on a string == === Check by a pattern on the beginning of a string === {% if my_string.startswith('pattern') %}{% endif %} {% if my_string[:len('pattern')] == 'pattern' %}{% endif %} === Check by a pattern on the end of a string === === Check by a pattern into a string ===")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Check a pattern on a string

Check by a pattern on the beginning of a string

{% if my_string.startswith('pattern') %}{% endif %}
{% if my_string[:len('pattern')] == 'pattern' %}{% endif %}

Check by a pattern on the end of a string

Check by a pattern into a string