Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Split a string based on change of character

by eyepopslikeamosquito (Chancellor)
on Jul 28, 2007 at 23:47 UTC ( #629349=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Split a string based on change of character
in thread Split a string based on change of character

As you might expect, I was tempted to (ab)use the magical $| flip-flop variable:

my @words = grep --$|, split /(?<=(.))(?!\1)/, $string;
but was able to restrain myself. :-)


Comment on Re^3: Split a string based on change of character
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2015-08-02 17:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (7 votes), past polls