Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^2: print number of characters after specific character

by johngg (Abbot)
on Sep 12, 2013 at 16:31 UTC ( #1053761=note: print w/replies, xml ) Need Help??

in reply to Re: print number of characters after specific character
in thread print number of characters after specific character

With your double split, rather than concatenation in a loop I'd go for join'ing an array slice, although substr seems more suited to the task.

$ perl -E ' $str = q{471234973798375754773971832374974447889743725345932}; say for map { join q{}, ( split m{} )[ 0 .. 9 ] } split m{47}, $str; say for map { substr $_, 0, 10 } split m{47}, $str;' 1234973798 7397183237 8897437253 1234973798 7397183237 8897437253 $

I hope this is of interest.



Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1053761]
[Discipulus]: floating was the keyword and.. to use supersearch is plus sign not a (plus) sin
Discipulus wonders if just numbers less than 18 are really floating..( chemical humor)
[Lady_Aleena]: Hello.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2017-06-26 21:01 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (594 votes). Check out past polls.