$replace
Gebruik: $replace(tekst,zoekopdracht,vervanging)
Categorie: tekst
Beschrijving:
Vervangt overeenkomsten met zoekopdracht in tekst door vervanging en retourneert de resulterende tekenreeks.
Voorbeeld:
De volgende instructies retourneren de aangegeven waarden:
$set(foo,I like cats the best)
$replace(%foo%,cat,dog) ==> "I like dogs the best"
$set(foo,I like cats the best)
$set(bar,cat)
$replace(%foo%,%bar%,dog) ==> "I like dogs the best"
$set(foo,I like cats the best)
$set(bar,cat)
$set(baz,dog)
$replace(%foo%,%bar%,%baz%) ==> "I like dogs the best"
$replace(I like cats the best,cat,dog) ==> "I like dogs the best"
$replace(I like cats the best,pig,dog) ==> "I like cats the best"
$replace(I like cats the best,cat,) ==> "I like s the best"
$replace(Bad replace,,_) ==> "_B_a_d_ _r_e_p_l_a_c_e_"