 <p>Since twig 1.12.2 you can use <a href="http://twig.sensiolabs.org/doc/filters/first.html"><code>first</code></a>:</p> <pre><code>{% if user.name|first|lower == i %} </code></pre> <p>For older version you can use <a href="http://twig.sensiolabs.org/doc/filters/slice.html"><code>slice</code></a>:</p> <pre><code>{% if user.name|slice(0, 1)|lower == i %} </code></pre>