STARTS_WITH
All functions > STRING > STARTS_WITH
Returns TRUE if a string starts with a specified prefix.
Signatures
Returns: TRUE if string starts with prefix, FALSE otherwise
STARTS_WITH(string: VARCHAR, prefix: VARCHAR) → BOOLEAN sql
| Parameter | Type | Required | Description |
|---|---|---|---|
string | VARCHAR | Yes | String to check |
prefix | VARCHAR | Yes | Prefix to look for |
Notes
- Case-sensitive comparison
- Returns FALSE if prefix is longer than string
- Returns TRUE if string and prefix are identical
Examples
FeatureQL
SELECT
f1 := STARTS_WITH('Hello World', 'Hello'), -- Starts with prefix
f2 := STARTS_WITH('Hello World', 'hello'), -- Case-sensitive
f3 := STARTS_WITH('Hello World', 'World'), -- Middle of string
f4 := STARTS_WITH('test', 'test'), -- Exact match
f5 := STARTS_WITH('test', 'testing'), -- Prefix longer than string
f6 := STARTS_WITH('€100', '€') -- Unicode prefix
;Result
| f1 BOOLEAN | f2 BOOLEAN | f3 BOOLEAN | f4 BOOLEAN | f5 BOOLEAN | f6 BOOLEAN |
|---|---|---|---|---|---|
| true | false | false | true | false | true |
On this page