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 byte length of a string counting each multi-byte char as multiple bytes.
USAGE
LENGTH(string)
Argument Name | Description |
---|---|
| The string to measure |
DETAILS
LENGTH()
is a string function that returns the byte length of a string, counting multi-byte characters as multiple bytes.
A NULL
is returned if the argument is NULL
.
EXAMPLES
SELECT LENGTH('mariadb');
+-------------------+
| LENGTH('mariadb') |
+-------------------+
| 7 |
+-------------------+
SELECT LENGTH(' ');
+---------------+
| LENGTH(' ') |
+---------------+
| 3 |
+---------------+
SELECT LENGTH(_utf8 x'E28098');
+-------------------------+
| LENGTH(_utf8 x'E28098') |
+-------------------------+
| 3 |
+-------------------------+