starts_with

Returns True if the haystack text string begins with needle.

Syntax

starts_with(needle, haystack)

Parameters

haystack and needle can be any of the following:

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

Case insensitive

Text comparisons are case insensitive. That is, starts_with("gdn", "GDN") evaluates to true.

Empty character

If you include an expression or formula column in this function, the expression or formula column could evaluate to an empty text string.

Be aware that all Strings end with an empty (zero-length) String. For example, ends_with("GDN", "") will evaluate to true.

On the other hand, ends_with("", "GDN") evaluates to false. An empty text string does not end with non-empty text strings.

Examples

  • [starts_with("hook", "fishhook")] is false.
  • If a keyword contains "hoopers", and is contained in a campaign that starts with "US", display "US brand":
    [if(and(contains(keyword, "hoopers"), starts_with(campaign, "US")), "US brand", "non-brand")]

Related links

Was this helpful?

How can we improve it?

Need more help?

Try these next steps:

true
Search
Clear search
Close search
Google apps
Main menu
3029752309318947475
true
Search Help Center
true
true
true
true
true
5055977
false
false