Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: splitting a number into several numbers

by dwatson06 (Friar)
on Jul 05, 2002 at 18:11 UTC ( #179698=note: print w/ replies, xml ) Need Help??


in reply to splitting a number into several numbers

If this is input by the user and you will not know how many numbers will be coming in...
You can grab the length of the input...
half it...
do a loop using the value...
then just grab substrings by an increment of twos.
Of course you will need to make sure the number coming in is even then handle other conditions on the odds.
Hope this helps.
Daniel


Comment on Re: splitting a number into several numbers

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (16)
As of 2014-08-27 14:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (239 votes), past polls