Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 studying the Monastery: (6)
As of 2014-12-29 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls