A.J.Millan wrote:
> May be of interest to add in the doc, that, when the second argument
> is negative, "the the first character of the substring is found by
> counting from the right rather than the left", but remember that the
> last actual character is -2, because -1 is just the ending NULL.
select substr('123', -1, 1);
returns '3'. The last character is NUL for you because you chose to
store NULs as part of your strings in the database - likely as a result
of a bug in your program. I bet length() also returns a result one
greater than what you'd expect just looking at your strings.
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users