Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: numbers masking

by poj (Prior)
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://970769]
help
Chatterbox?
[Lady_Aleena]: This is one of my oldest accounts on the web. 8)
[Corion]: Lady_Aleena: Hehe - I think this is also my oldest active account on the web. I have an old university email address but that only gets spam nowadays :)
Discipulus arrived at work 1 hour late.. he do not noticed the clock bell
[Lady_Aleena]: My Wikipedia account is 3 years - 10 days younger.
[fux]: Hi folks:) Lady_Aleena: congrats!
vrk takes a handful of cookies from the platter on the sideboard.
Discipulus is preparing a big party for his 15th

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2017-04-26 07:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (470 votes). Check out past polls.