Skip to content

CHARACTER_LENGTH

  • expression: The string argument for which the length will be calculated. This can be a constant, variable, or column of either character or binary data type. The function will return the number of characters in the expression.
SELECT CHARACTER_LENGTH('Hello World') AS Length;
+--------+
| Length |
+--------+
| 11 |
+--------+

The CHARACTER_LENGTH string function in MySQL returns the length of the specified string character. In the provided example, it returns the length of the string ‘Hello World’ which is 11.