charlen

The charlen() function returns the number of characters (single-byte or multiple-byte) in the argument string.

By contrast, the length() function returns the number of bytes in a string, which equals the number of characters only for single-byte character encodings. Also in contrast to the length() function, the charlen() function does not accept a list as an argument.

result = charlen (string)
string

Required. A character string in single-byte or multiple-byte encoding.

result Contains an integer that indicates the number of characters in string.

string = "BeyondTrust Software";
howLong = charlen(string);

In this example, the howLong variable contains the integer value 20.

For more information, please see length.