R/ph_replacement.R
string_replace.Rd
In a template text with placeholders, these placeholders are replaced with values that are specified via the list of replacement values. As a result the text is returned with the placeholders replaced by the values specified in the list of replacement values.
string_replace(
ps_tmpl,
pl_repl_value,
ps_ph_open_tag = "<ph>",
ps_ph_end_tag = "</ph>"
)
template text containing placeholders
list with replacement values
open-tag for placeholder
end-tag for placeholder
s_result where placeholders have been replaced with replacement values
Placeholders are words that are enclosed between an opening tag and an end tag. These tags can be specified as arguments ps_ph_open_tag and ps_ph_end_tag. The word between the tags corresponds to the name of the placeholder. This name is also used as a name in the list of replacement values. The value with which the placeholder is to be replaced is given as the list element associated with the name of the placeholder.