ElnurTwigExtensionsBundle Currently, the bundle provides just two operators: starts_with and ends_with. {% if 'Hello world' starts_with 'Hello' %} {% if 'Hello world' ends_with 'world' %}