replace

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

Always counts in the natural direction of the advertiser’s locale. For example, if the advertiser’s language is English, this function counts from left to right.

Syntax

replace(string, start, length, new_text)

string and new_text can be any of the following:

  • A String constant, such as "GDN".
  • A Search Ads 360 variable that is a String, such as Keyword, Campaign, Engine_status, and so on.
  • An expression or formula column that returns a String.

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".

Was this helpful?
How can we improve it?