in reply to Replacing multiple spaces into one character?
prints: _perlmonks_is_the_coolest$str= " perlmonks is the coolest"; $str =~ s/\s+/_/g; print $str;
(I left out the i modifier because space is the same in capital or lower-case. I don't think that would change the behavior, though!)
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Replacing multiple spaces into one character?
by Boldra (Curate) on Oct 09, 2001 at 18:26 UTC |