Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by ivancho (Hermit)
on Nov 30, 2005 at 10:19 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://512896]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2024-04-24 14:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found