Remove the specified character from any position in the string

How to remove the specified character from any position in the Anqi CMS template?

cutThe filter can remove specified characters from any position in a string. Operations such as removing special characters, spaces, etc., can all be usedcutFilter

Usage method

cutHow to use the filter:

{{ obj|cut:"关键词" }}

For example, to converttestofsTo remove, it can be written as:

{{ "test"|cut:"s" }}
# 显示结果
tet

Example Demonstration

{{ 15|cut:"5" }}
{{ "Hello world"|cut: " " }}
# 显示结果
1
Helloworld