Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I want this to return 'Any help would be greatly appreciated'.$str ="Any help would be greatly appreciated"; $str =~ s/\s{2,}/\s/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replace consecutive whitespaces with single whitespace
by tilly (Archbishop) on Mar 26, 2009 at 05:56 UTC | |
by JavaFan (Canon) on Mar 26, 2009 at 12:47 UTC | |
by tilly (Archbishop) on Mar 26, 2009 at 21:38 UTC | |
by JavaFan (Canon) on Mar 27, 2009 at 08:10 UTC | |
by tilly (Archbishop) on Mar 27, 2009 at 13:20 UTC | |
|
Re: Replace consecutive whitespaces with single whitespace
by jwkrahn (Abbot) on Mar 26, 2009 at 06:23 UTC | |
|
Re: Replace consecutive whitespaces with single whitespace
by lakshmananindia (Chaplain) on Mar 26, 2009 at 05:56 UTC | |
|
Re: Replace consecutive whitespaces with single whitespace
by Anonymous Monk on Mar 27, 2009 at 23:10 UTC |