Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Scrubbing a string

by princepawn (Parson)
on Aug 24, 2007 at 20:58 UTC ( #634963=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    scrub 'pure', 'p!u-r-*e'; # returns pure
    
  2. or download this
    sub string_clean {
      my ($pure, $dirty) = @_;
    ...
      my @cleaned = grep { $pure{$_} } @dirty;
      return join '', @cleaned;
    }
    
  3. or download this
    scrub 'impure' => 'pure' ; # yields 'pure'
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://634963]
Approved by TStanley
Front-paged by Roy Johnson
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2021-04-14 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?