Returns the first length characters in string counting from the beginning of the String. 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
left(string, length)
string 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.
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
-
[left("Hello World!", 5)]
returns Hello. -
[left("Hello World!", 0)]
returns "" (empty string). -
[left("Hello World!", -1)]
is an error. Negative numbers are not valid. -
[left(right("Hello World!", 6), 5)]
returns World.