Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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?
[oiskuu]: Someone needs to re-read How do I use the power of consideration responsibly? carefully. Consideration is not intended for stamping out humor, AFAIK.
[oiskuu]: E.g. Re^3: Big thank you to the Perl community. is surely dry humor (not mine). Don't they teach humor in german schools!?
[LanX]: you don't see the whole picture
[LanX]: But reu germans have no humor, better to refrain from this site till the troll is gone...
[LanX]: true

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2017-04-27 19:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (512 votes). Check out past polls.