CHAR_LENGTH
Descriptionβ
Calculates the length of a string. For multi-byte characters, returns the number of characters.
Currently only supports utf8
encoding
Aliasβ
- CHARACTER_LENGTH
Syntaxβ
CHAR_LENGTH ( <str> )
Parametersβ
Parameter | Description |
---|---|
<str> | The string to calculate the length of |
Return valueβ
The length of the string
Exampleβ
select CHAR_LENGTH("abc"),CHAR_LENGTH("δΈε½")
+-------------------------+----------------------------+
| character_length('abc') | character_length('δΈε½') |
+-------------------------+----------------------------+
| 3 | 2 |
+-------------------------+----------------------------+