start page | rating of books | rating of authors | reviews | copyrights

Programming Perl

Programming PerlSearch this book
Previous: 3.2.177 uc Chapter 3
Functions
Next: 3.2.179 umask
 

3.2.178 ucfirst

ucfirst 

EXPR

This function returns a version of EXPR (or $_ if EXPR is omitted) with the first character uppercased, that is, capitalized. This is the internal function implementing the \u escape in double-quoted strings. POSIX setlocale (3) settings are respected.

To force initial caps, and everything else lowercase, use:

ucfirst lc $word

which is equivalent to "\u\L$word" .


Previous: 3.2.177 uc Programming Perl Next: 3.2.179 umask
3.2.177 uc Book Index 3.2.179 umask