How to remove a specified character from any position in a string in Anqi CMS template?
cut
The filter can remove specified characters from any position in a string. Operations such as removing special characters, spaces, etc., can be performed using it.cut
Filter
Usage Instructions
cut
How to use the filter:
{{ obj|cut:"关键词" }}
For example, to transformtest
tos
remove, it can be written as:
{{ "test"|cut:"s" }}
# 显示结果
tet
Here is an example demonstration
{{ 15|cut:"5" }}
{{ "Hello world"|cut: " " }}
# 显示结果
1
Helloworld