Replace a specific keyword in a string to another keyword

How to replace a word in a string with another word in Anqi CMS template?

replaceThe filter can replace the old word old in the string with the new word new, and return the replaced new string. If old is empty, it will match at the beginning of the string and after each UTF-8 sequence. If new is empty, remove old.

How to use

replaceUsage of filters:

# Replace the old keyword with the new keyword
{{obj|replace:"old,new"}}

Use between old and new to distinguish.

{{"Welcome to use Anqi CMS"|replace:"Anqi,anqi"}}
# Show results
Welcome to use anqiCMS

Sample Demo

{{"Welcome to use Anqi CMS"|replace:"Anqi,anqi"}}
# Show results
Welcome to use anqiCMS
{{"Welcome to use Anqi CMS"|replace:",-"}}
# Show results
-Welcome to use Anqi C-M-S-
{{"Welcome to use Anqi CMS"|replace:"Anqi,"}}
# Show results
Welcome to welcome Anqi CMS