やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

SQLite3コア関数 length

 文字列の長さを返す。

成果物

構文

文字列長

select length(文字列);
文字列長

バイト長

select length(hex(文字列))/2;
バイト長

整数値の桁数

select length(整数値);
整数値の桁数

select length('abc');
3
select length(hex('abc'))/2;
3
select length('文字列');
3
select length(hex('文字列'))/2;
9
select length(123);
3
select length(123.45);
6

対象環境

$ uname -a
Linux raspberrypi 4.19.42-v7+ #1218 SMP Tue May 14 00:48:17 BST 2019 armv7l GNU/Linux

前回まで