length#

Synopsis#

$len = length($string);
$len = length("café");   # 4 (characters, not bytes)

Description#

Returns the number of characters in a string.

Returns the character count (not byte count) for Unicode correctness. length(undef) returns undef, matching perl5 behavior.

See also#

substr