Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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
Domain Nodelet?
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 imbibing at the Monastery: (2)
As of 2023-05-31 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?