Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Stripping characters...

by fruiture (Curate)
on Mar 04, 2003 at 08:44 UTC ( #240273=note: print w/replies, xml ) Need Help??


in reply to Stripping characters...

To create a complementary character class, use [^...], see perlre. In order to strip characters, tr/// is the better (=more efficient) choice:

$string =~ tr/a-zA-Z//cd;

See perlop for what tr///cd does.

--
http://fruiture.de

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://240273]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2017-10-17 01:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (218 votes). Check out past polls.

    Notices?