String-starts-with operator

Syntax

…string-expr… STARTS WITH …string-expr…

Typing

STRING, STRING -> BOOL

Description

Test if a string starts with a given substring.

Unlike the LIKE operator, does not require any of its operands to be a literal string value.

Examples

expression evaluates to
"foobar" STARTS WITH "foo" TRUE
"foo"||"bar" STARTS WITH 2*"x" FALSE

See Also

String-ends-with operator Find the first or last occurrence of a character Comparing strings with patterns