Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Answer: How can I strip an arbitary number of leading spaces from a string?

by Anonymous Monk
on Sep 28, 2004 at 14:04 UTC ( #394584=categorized answer: print w/replies, xml ) Need Help??

Q&A > strings > How can I strip an arbitary number of leading spaces from a string? - Answer contributed by Anonymous Monk

$string =~ s/^\s+//gm; this will start at the beginning and only continue as long as there is whitespace left at the beginning of the string.

  • Comment on Answer: How can I strip an arbitary number of leading spaces from a string?
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the sunlight beams...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2017-01-17 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (157 votes). Check out past polls.