Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

String functions (length, lc, uc, index)

  • length

  • lc

  • uc

  • ucfirst

  • lcfirst

  • length STRING - number of characters

  • lc STRING - lower case

  • uc STRING - upper case

  • lcfirst STRING - lower case

  • ucfirst STRING - upper case

use 5.010;
use strict;
use warnings;

my $name = 'Foo Bar';
say length $name;                 # 7
say length "Hello World!\n";      # 13
say length 19;                    # 2