Removes specified characters from any position in the string

How to remove a specified character at any position in a string in the Anqi CMS template?

cutThe filter can remove specified characters from any position in the string. If you remove special characters, spaces, etc., you can use itcutFilter

How to use

cutHow to use filters:

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

For exampletestIn-housesRemove, you can write:

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

Sample Demo

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