The Truncate allows you to truncate a string.
Drupal 9.x.
Install this module as usual. Please see https://www.drupal.org/docs/extending-drupal/installing-modules
paramètres: - n number of characters defaukt to 150 - endchar default to '…'
{{ the_string|truncate(100, '!') }}