Skip to main content

CHAR_LENGTH

Returns the length of the string str, measured in characters. A multibyte character counts as a single character. This means that for a string containing five 2-byte characters, LENGTH() returns 10, whereas CHAR_LENGTH() returns 5.

Syntax

CHAR_LENGTH(<expr>);

Arguments

ArgumentsDescription
<expr>The string

Return Type

BIGINT

Examples

SELECT CHAR_LENGTH('hello');
+----------------------+
| CHAR_LENGTH('hello') |
+----------------------+
| 5 |
+----------------------+
Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today