Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: How do I quickly strip blank space from the beginning/end of a string?

by ikegami (Pope)
on Jul 21, 2009 at 21:04 UTC ( #782079=note: print w/replies, xml ) Need Help??


in reply to How do I quickly strip blank space from the beginning/end of a string?

$x =~ /.*[A-Z]/g and $x =~ s/\G.*//
can be written as
$x =~ s/(.*[A-Z]).*/$1/
and as
$x =~ s/.*[A-Z]\K.*// (requires 5.10.0)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2019-06-25 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (108 votes). Check out past polls.

    Notices?