In SQLite, the char()
function returns a string based on the unicode code points provided as arguments.
You can provide one or more arguments, each of which is a unicode code point. The function then returns a string based on those code points.
Syntax
The syntax goes like this:
char(X1,X2,...,XN)
You can provide one or more arguments. Each argument should be a unicode code point.
Examples
Here’s a basic example to demonstrate.
SELECT char(65);
Return:
A
Here’s another example with multiple code points.
SELECT char(65, 66, 67, 68);
Return:
ABCD
Here’s one that spells a word.
SELECT char(67, 97, 116);
Return:
Cat
And here’s one that includes a new line.
SELECT char(67, 97, 10, 116);
Return:
Ca t