Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 meditating upon the Monastery: (10)
As of 2021-05-14 14:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (150 votes). Check out past polls.

    Notices?