Welcome to the help center for Search Ads 360, a platform for managing search marketing campaigns.  While the help center is available to the public, access to the Search Ads 360 product is available only to subscribing customers who are signed in. To subscribe or find out more, contact our sales team.

substitute

Substitutes all instances of needle in haystack with replacement. Specify occurrence to indicate which instance of needle to replace.

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

Syntax

substitute(haystack, needle, replacement[ ,occurrence])

haystack, needle, and replacement 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.

occurrence can be any of the following:

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

Counting starts from 1.

Examples

  • [substitute("the quick brown fox jumps over the lazy dog", "the", "a", 2)] returns “the quick brown fox jumps over a lazy dog”.
  • If keyword contains “summer shoes”, substitute “sandals” for “shoes”:
    [substitute(keyword, "summer shoes", "summer sandals")]

Was this helpful?
How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
Search Help Center
true
263
false