@aubrey
To remove numbers using Twig in OctoberCMS, you can use the replace
filter function. Here is an example of how you can achieve this:
1 2 3 4 |
{% set string = 'Your string with numbers 123 and more.' %} {% set result = string|replace('/d+/', '') %} {{ result }} |
In this example, the replace
filter function is used to replace any sequence of one or more digits (d+
) with an empty string (''
). As a result, all numbers in the string will be removed.