Function startsWith()
judges whether a string starts with a specified substring, and returns 1 for true, 0 for false.
Arguments:
- String <string>
- Substring <string>
Returns:
- Result <number>
If the string and the sub string are non-homologous, Cartesian Product will be applied when the function is called in a WITH clause, or column length will be trimmed when called in a RETURN clause.
Constant
Example: judge if 'daS351sXFE51scf' starts with 'daS351s'
return startsWith("daS351sXFE51scf", "daS351s")
Function
Example: judge if 'daS351sXFE51scf' in lowercase starts with 'das351s'
return startsWith(lower("daS351sXFE51scf"), "daS351s")
Alias
Example: find 10 numbers and judge if those numbers start with 170
find().nodes({@phone}) as n
limit 10
return n.number, startsWith(n.number, "170")
Property
Example: find 10 numbers that start with 170
find().nodes({startsWith(@phone.number, "170")}) as n
limit 10
return n.number