starts_with

Description

Syntax

BOOLEAN STARTS_WITH(VARCHAR str, VARCHAR prefix)

It returns true if the string starts with the specified prefix, otherwise it returns false. If any parameter is NULL, it returns NULL.

example

1. MySQL [(none)]> select starts_with("hello world","hello");
2. +-------------------------------------+
3. | starts_with('hello world', 'hello') |
4. +-------------------------------------+
5. |                                   1 |
6. +-------------------------------------+

8. MySQL [(none)]> select starts_with("hello world","world");
9. +-------------------------------------+
10. | starts_with('hello world', 'world') |
11. +-------------------------------------+
12. |                                   0 |
13. +-------------------------------------+

keywords

1. STARTS_WITH