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

keywords

  1. STARTS_WITH