Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • CHAR_LENGTH(str) & CHARACTER_LENGTH(str) MySQL string function

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 336
    Comment on it

    CHAR_LENGTH(str)

    The string str length measured in characters is returned by CHAR_LENGTH. It also counts a single character for a multibyte character. This means, for a string containing five 2-byte characters, LENGTH() returns 10, whereas CHAR_LENGTH() returns 5.

    CHARACTER_LENGTH(str)

    CHARACTER_LENGTH() is a synonym for CHAR_LENGTH().

    mysql> SELECT CHAR_LENGTH('hello');
    +----------------------+
    | CHAR_LENGTH('hello') |
    +----------------------+
    |                    5 |
    +----------------------+
    1 row in set (0.00 sec)
    
    mysql> SELECT CHAR_LENGTH('23569874');
    +-------------------------+
    | CHAR_LENGTH('23569874') |
    +-------------------------+
    |                       8 |
    +-------------------------+
    1 row in set (0.00 sec)
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: