in reply to Re: Re: Remove leading spaces (left justify)
in thread Remove leading spaces (left justify)

Sorry. I misunderstood you. This would do it.

$s =~ s[^ ][]mg while not $s =~ m[^[^ ]]mg;

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller

Replies are listed 'Best First'.
Re: Re: Re: Re: Remove leading spaces (left justify)
by bobn (Chaplain) on May 17, 2003 at 19:49 UTC
    Very concsie, but gets very slow for big strings with lots of space, as it will loop through the entire string once for each leading space it removes.

    Bob Niederman, http://bob-n.com