Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Case conversion

by inman (Curate)
on Sep 01, 2005 at 15:54 UTC ( [id://488408]=note: print w/replies, xml ) Need Help??


in reply to Re: Case conversion
in thread Case conversion

Why type y/a-zA-Z/A-Za-z/ when you can type my $inverted = join '', map {$_ = uc eq $_ ? lc : uc} split //, $input;

Replies are listed 'Best First'.
Re^3: Case conversion
by blazar (Canon) on Sep 01, 2005 at 16:22 UTC
    Well,
    1. it was about vowels,
    2. also, many people use split like that, but I find that a simple match (in list context) is better suited. In this case, with reference to your example:
      my $inverted = join '', map { whatever } $input =~ /./g;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://488408]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-03-19 04:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found