Notification

Please be advised that the Customer Support team does not provide troubleshooting services in your current display language. To contact Support team staff, please first switch to English or other supported languages (Spanish, Portuguese or Japanese). 

replace

Replaces characters in string with new_text, starting at position start and counting length characters. Counting starts from one (1) (not zero (0)).

Always counts in the natural direction based on the selected advertiser's locale. For example, if the advertiser's language is English, this function counts from right to left.

Note: This function is only available in Templates and can't be used in reporting.

Syntax

replace(string, start, length, new_text)

Parameters

string and new_text can be any of the following:

  • Static text, such as 'GDN'.
  • A Search Ads 360 variable that uses a text format, such as Keyword, Campaign and so on.
  • An expression or formula column that returns a text value.

start and length can be any of the following:

  • A positive constant, such as 5.
  • A Search Ads 360 variable that is a positive number.
  • An expression or formula column that returns a positive number.

Examples

  • [replace("Hello World", 7, 5, "Sylvester")] returns "Hello Sylvester".

  • [replace("Hello World", 6, 6, "")] returns "Hello".

Related links

Was this helpful?

How can we improve it?

Need more help?

Try these next steps:

true
Search
Clear search
Close search
Main menu
10043889713149048171
true
Search Help Centre
true
true
true
true
true
5055977
false
false