Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Elegant way to split into sequences of identical chars?

by ivancho (Hermit)
on Nov 30, 2005 at 10:19 UTC ( #512896=note: print w/replies, xml ) Need Help??


in reply to Elegant way to split into sequences of identical chars?

clearly not as clean as the regexp solutions, but just for laughs
perl -le '/$c/||$i++, $d[$i].=$c=$_ for split "","aaaabbbccdaaa"; prin +t "@d"' aaaa bbb cc d aaa

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2019-05-27 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (156 votes). Check out past polls.

    Notices?