This module allows Drupal to use the Symfony Unicode String library within Twig templates. This provides enhanced string manipulation capabilities directly in your templates. To enable this, you need to configure allowed classes in your Drupal settings file.
Adds support for the Twig String Extension library
Symfony Unicode String
In order to access the Symfony\Component\String\UnicodeString class in twig, you need to add it as an allowed class in your settings.php with the twig_sandbox_allowed_classes setting. For example:
$settings['twig_sandbox_allowed_classes'] = [
'Symfony\Component\String\UnicodeString',
'Drupal\Core\Template\Attribute',
];
See more on how this is processed in the TwigSandboxPolicy.