Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 766 Bytes

text.md

File metadata and controls

40 lines (27 loc) · 766 Bytes

text: String functions

Additional string functions for SQLite. Adapted from extension-functions.c by Liam Healy.

Provides following functions:

reverse(source)

Returns reversed string.

sqlite> select reverse('hello world');
dlrow olleh

split_part(source, sep, part)

Splits source string on sep and returns the given part (counting from one).

sqlite> select split_part('one;two;three', ';', 2);
two

If sep is composed of multiple characters, each character is treated as separator. E.g.:

sqlite> select split_part('one/two\three', '/\', 2);
two

Download

Usage

sqlite> .load ./text
sqlite> select reverse('hello');