The template
function is used to reconstruct a text from a variable and a source text.
Parameters
variable
(string): the string you want to add into the text. This parameter is mandatory.template
(string): The template where the variable will be added. This parameter is mandatory. The template is using the same format as the printf function-
Examples
Here are a few examples of how to use the template
function:
Example 1: Replace a string with another string
replace("orange", template="I like %s", )
This will gives : I like orange