Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Answer: How do I split a long string without any spaces up?

( #9952=categorized answer: print w/ replies, xml ) Need Help??

Q&A > regular expressions > How do I split up a long string with no spaces? contributed by vroom

$string=~s/(\S{$numoflettersbeforebreaking})/$1 /g;

Comment on Answer: How do I split a long string without any spaces up?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2015-07-03 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls