StartsWith, EndsWith

Checking for a prefix or suffix in a string.

Required arguments:

  • Source string;
  • The substring being searched for.

The arguments can be of the String or Utf8 type and can be optional.

Examples

SELECT StartsWith("abc_efg", "abc") AND EndsWith("abc_efg", "efg"); -- true
SELECT StartsWith("abc_efg", "efg") OR EndsWith("abc_efg", "abc"); -- false
SELECT StartsWith("abcd", NULL); -- null
SELECT EndsWith(NULL, Utf8("")); -- null