Evaluates to true if haystack begins with needle.
Syntax
starts_with(haystack, needle)
haystack and needle 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.
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 string.
Be aware that all Strings start with an empty (zero-length) String. That is, starts_with("GDN", "")
evaluates to true.
Note that starts_with("", "GDN")
evaluates to false. That is, an empty String does not start with non-empty 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")]