truncate

The truncate filter trims the given string down to the specified length. It can optionally append another string to end.

{{ my_variable|truncate(30,'... Read more.') }}
{# Returns "This is my strin... Read more." #}