Returns true if the leftmost set of characters of a column of values matches a pattern. The source value can be any data type, and the pattern can be a , regular expression, or a string.

String literal example:

startswith(FullName,'Mr.')

Output: Returns true if the first three letters of the FullName column value are "Mr.". 

 example:

startswith(CustId,`{alpha-numeric}{6}`)

Output: Returns true if the CustId column begins with a six-digit alpha-numeric sequence. Otherwise, the value is set to false.

Regular expression pattern example:

if(startswith(phone,/^(\+0?1\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$/),'phone - ok','phone - error')

Output: Returns phone - ok if the value of the phone column begins with a value that matches a 10-digit U.S. phone number. Otherwise, the output value is set to phone - error.

startswith(column_any,pattern[,ignore_case])


ArgumentRequired?Data TypeDescription
column_anyYanyName of the column to be applied to the function
patternYstringPattern or literal expressed as a string describing the pattern to which to match.
ignore_caseNstringWhen true, matching is case-insensitive. Default is false.

column_any

Name of the column to be searched.

Required?Data TypeExample Value
YesColumn referencemyColumn

pattern

, regular expression, or string literal to locate in the values in the specified column.

Required?Data TypeExample Value
YesString`{zip}`

ignore_case

When true, matches are case-insensitive. Default is false

NOTE: This argument is not required. By default, matches are case-sensitive.

 

Required?Data TypeExample Value
NoString value'false'

Example - STARTSWITH and ENDSWITH Functions