Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (16)
As of 2016-08-31 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (432 votes). Check out past polls.