Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by vroom (Pope)
on May 02, 2000 at 20:47 UTC ( #9952=categorized answer: print w/replies, xml ) Need Help??

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

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

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2016-12-11 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (169 votes). Check out past polls.