Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Splitting a string

by mickeyn (Priest)
on Feb 09, 2006 at 08:08 UTC ( #529018=note: print w/replies, xml ) Need Help??


in reply to Splitting a string

Please try this:

my $mystring = "perl monks"; my $tmpstring = $mystring; my $my_splitted_string = ""; while ($tmpstring) { $tmpstring =~ m/^(\w{2})/ and $my_splitted_string .= $1." "; $tmpstring =~ s/^.//; } print "$my_splitted_string\n";

Enjoy,
Mickey

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://529018]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2017-04-29 02:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.