in reply to Splitting a string
my $mystring = "perl monks"; # Oops, I thought it was supposed to span words. Thanks for the heads- +up, kwaping #(my $splitted = $mystring) =~ s/(?<=.)(\S)\s*(?=\S)/$1 $1/g; (my $splitted = $mystring) =~ s/(?<=\S)(\S)(?=\S)/$1 $1/g; print $splitted;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Splitting a string
by kwaping (Priest) on Feb 08, 2006 at 18:29 UTC |