Dear ALL,
Many dialects of SQL (MySQL, SQLite, etc.) have a handy SUBSTR() function which extract a substring from a string (starting at any position), for example:
SELECT SUBSTR(CustomerName, 2, 5) AS ExtractString FROM Customers;
However, the ZMSQL library (
https://wiki.freepascal.org/ZMSQL) offers two rather unusual variations of this function, as follows:
substr_after(source, substring) Returns the part of source that comes after substring. If substring is not found an empty string is returned.
substr_before(source, substring) Returns the part of source that comes before substring. If substring is not found an empty string is returned.
I do not understand how these functions work and have not been able to find any examples. Could some one provides me with a few hints?
Thanks in advance!
With
best wishes,