Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Replacing whitespaces with a regex

by choroba (Canon)
on Mar 04, 2013 at 09:54 UTC ( #1021621=note: print w/ replies, xml ) Need Help??


in reply to Replacing whitespaces with a regex

Just do

$words =~ s/\s\s+$/ /;
whithout any if. If there is multiple whitespace, it will be replaced, if not, nothing happens.
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Replacing whitespaces with a regex
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021621]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2015-07-30 09:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls