--- name: length status: documented runtime: pp source: src/runtime/pp/strings/mod.rs --- ```{index} single: length; Perl built-in (pp runtime) ``` # length ## Synopsis ```perl $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