Collections:
CHAR_LENGTH() - Number of Characters
How to count the number of characters of a giving string using the CHAR_LENGTH() function?
✍: FYIcenter.com
CHAR_LENGTH(string) is a MySQL built-in function that returns the
number of characters of a giving string. For example:
SELECT CHAR_LENGTH('dba.FYIcenter.com');
-- +----------------------------------+
-- | CHAR_LENGTH('dba.FYIcenter.com') |
-- +----------------------------------+
-- | 17 |
-- +----------------------------------+
Reference information of the CHAR_LENGTH() function:
CHAR_LENGTH(str): num Returns the length of the string str, measured in code points. A multibyte character counts as a single code point. This means that, for a string containing two 3-byte characters, LENGTH() returns 6, whereas CHAR_LENGTH() returns 2. Arguments, return value and availability: str: Required. The given string to count the number of characters for. num: Return value. The number of characters in the given string. Available since MySQL 4.0.
Related MySQL functions:
⇒ CHARACTER_LENGTH() - Synonym for CHAR_LENGTH()
⇐ CHAR() - Building String from Byte Values
2023-11-10, 1877🔥, 0💬
Popular Posts:
How To End a Stored Procedure Properly in SQL Server Transact-SQL? Where the end of the "CREATE PROC...
How to download and install the scaled-down database AdventureWorksLT in SQL Server? If you want to ...
How To Convert Binary Strings into Hexadecimal Character Strings in SQL Server? When a query returns...
How To Convert a Unicode Strings to Non-Unicode Strings in SQL Server Transact-SQL? Since Unicode ch...
What Are the Differences between BINARY and VARBINARY in MySQL? Both BINARY and VARBINARY are both b...