diff options
author | Scott Baker <scott@perturb.org> | 2021-06-02 13:31:28 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2021-06-08 09:53:25 -0700 |
commit | 818defb9eb745d8ae4b08e9f313bde316f68aced (patch) | |
tree | de1c9d4d398f75f3f83e95508c6215cd73166a51 /pod/perlfunc.pod | |
parent | 1c1bafd87b5f8ac0dc0f911bd620d675a4e399e3 (diff) | |
download | perl-818defb9eb745d8ae4b08e9f313bde316f68aced.tar.gz |
Simply the uc() and lc() documentation for novices
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r-- | pod/perlfunc.pod | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 08e1ce1d0d..baf17b3f4f 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -3896,10 +3896,10 @@ X<lc> X<lowercase> =for Pod::Functions return lower-case version of a string -Returns a lowercased version of EXPR. This is the internal function -implementing the C<\L> escape in double-quoted strings. +Returns a lowercased version of EXPR. If EXPR is omitted, uses +L<C<$_>|perlvar/$_>. -If EXPR is omitted, uses L<C<$_>|perlvar/$_>. + my $str = lc("Perl is GREAT"); # "perl is great" What gets returned depends on several factors: @@ -3946,6 +3946,12 @@ outside the ASCII range is the character itself. =back +B<Note:> This is the internal function implementing the +L<C<\L>|perlop/"Quote and Quote-like Operators"> escape in double-quoted +strings. + + my $str = "Perl is \LGREAT\E"; # "Perl is great" + =item lcfirst EXPR X<lcfirst> X<lowercase> @@ -9335,16 +9341,23 @@ X<uc> X<uppercase> X<toupper> =for Pod::Functions return upper-case version of a string -Returns an uppercased version of EXPR. This is the internal function -implementing the C<\U> escape in double-quoted strings. -It does not attempt to do titlecase mapping on initial letters. See -L<C<ucfirst>|/ucfirst EXPR> for that. +Returns an uppercased version of EXPR. If EXPR is omitted, uses +L<C<$_>|perlvar/$_>. -If EXPR is omitted, uses L<C<$_>|perlvar/$_>. + my $str = uc("Perl is GREAT"); # "PERL IS GREAT" This function behaves the same way under various pragmas, such as in a locale, as L<C<lc>|/lc EXPR> does. +If you want titlecase mapping on initial letters see +L<C<ucfirst>|/ucfirst EXPR> instead. + +B<Note:> This is the internal function implementing the +L<C<\U>|perlop/"Quote and Quote-like Operators"> escape in double-quoted +strings. + + my $str = "Perl is \Ugreat\E"; # "Perl is GREAT" + =item ucfirst EXPR X<ucfirst> X<uppercase> |