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 |
+-------------------------+----------------------------+