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

Re: numbers masking

by poj (Priest)
on May 16, 2012 at 07:47 UTC ( #970769=note: print w/ replies, xml ) Need Help??


in reply to numbers masking

You could split the string, process each character skipping over the non-digits and then join back together.

#!perl use strict; my $Number = ' 5 4 1 321 0 698 7 3 210 2 0 0'; my @Number = split //,$Number; my $count = 0; for my $i (0..$#Number){ next if ($Number[$i] =~ /\D/); if (($count > 5) && ($count < 14)){ $Number[$i] = "X"; } ++$count; } print join '',@Number;
poj


Comment on Re: numbers masking
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2014-11-29 02:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (203 votes), past polls