CHAR_LENGTH()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns the number of characters in the given string, counting each multi-byte char as 1 character.
USAGE
CHAR_LENGTH(string)
Argument Name | Description |
---|---|
| The string to measure. |
DETAILS
CHAR_LENGTH()
is a string function that returns the number of characters (not bytes) in the given string.
Each multi-byte character counts as 1 character.
The return value is an integer.
A NULL
is returned if the argument is NULL
.
EXAMPLES
SELECT CHAR_LENGTH('m a r i a db');
+-----------------------------+
| CHAR_LENGTH('m a r i a db') |
+-----------------------------+
| 12 |
+-----------------------------+
SELECT CHAR_LENGTH(_utf8 x'E28098');
+------------------------------+
| CHAR_LENGTH(_utf8 x'E28098') |
+------------------------------+
| 1 |
+------------------------------+