Skip to content

Commit

Permalink
Simply the uc() and lc() documentation for novices
Browse files Browse the repository at this point in the history
  • Loading branch information
scottchiefbaker authored and khwilliamson committed Jun 8, 2021
1 parent 1c1bafd commit 818defb
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions pod/perlfunc.pod
Expand Up @@ -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:

Expand Down Expand Up @@ -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>

Expand Down Expand Up @@ -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>

Expand Down

0 comments on commit 818defb

Please sign in to comment.