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
In reply to Re: Replacing multiple spaces into one character?
by John M. Dlugosz
in thread Replacing multiple spaces into one character?
by r.joseph
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |