Replace

This function replaces the first string value with the second string value in the specified string.

Arguments

Replace(1,2,3)

Ordinal Type Required Description
1 String True String to search
2 String True String to find
3 String True Replacement string

Example

%%[

var @blurb
var @blurbReplaced

set @blurb = AttributeValue("blurb") /* value from attribute or DE column in send context */
set @blurb = "" /* or a literal value */
set @blurb = concat(@blurb, "Enjoy rewards that you choose, like discounts on accessories<br>")
set @blurb = concat(@blurb, "and other services. The options are only available to Members.<br><br>")
set @blurb = concat(@blurb, "Enjoy the rewards today!<br>")

set @blurbReplaced = replace(@blurb, "<br>", " ")

]%%
blurb: %%=v(@blurb)=%%
<br>blurbReplaced: %%=v(@blurbReplaced)=%%

Output

blurb: Enjoy rewards that you choose, like discounts on accessories
and other services. The options are only available to Members.

Enjoy the rewards today!

blurbReplaced: Enjoy rewards that you choose, like discounts on accessories and other services. The options are only available to Members. Enjoy the rewards today!