Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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?
[TCLion]: Ok I have used SoPW, any feedback would be appreciated
[Eily]: yes, but if you have to borrow it please don't leave any parselmouth stains on it!
[TCLion]: was wondering why is the code window so small for SoPW?
[LanX]: qu'est-ce que c'est?
[LanX]: oh millennial folklore. ..
[TCLion]: Headed to lunch late, be back soon

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (14)
As of 2017-03-23 17:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (292 votes). Check out past polls.