in reply to Re^2: How to eliminate white spaces,tabs,new lines at thestart and end of a long string ??
in thread How to eliminate white spaces,tabs,new lines at thestart and end of a long string ??

Whatever floats your boat... I think that's somewhat less readable, though. But not so much so that I'd complain. I'd expect that doing it without the for would probably be more efficient, so if I found your code in a long loop, I'd likely change it for the more verbose form.

-sauoq
"My two cents aren't worth a dime.";
  • Comment on Re^3: How to eliminate white spaces,tabs,new lines at thestart and end of a long string ??
  • Download Code

Replies are listed 'Best First'.
Re^4: How to eliminate white spaces,tabs,new lines at thestart and end of a long string ??
by Aristotle (Chancellor) on Nov 24, 2005 at 19:55 UTC

    I didn’t suggest it’s better. I prefer it because I find it slightly less noisy and repetitive; as you said, whatever floats one’s boat.

    You’re in trouble if that’s the best opportunity for optimisation you can see, though… :-)

    Makeshifts last the longest.

      You’re in trouble if that’s the best opportunity for optimisation you can see, though… :-)

      Actually, I think I'm probably doing quite well if that's the best opporturnity for optimization. ;-)

      -sauoq
      "My two cents aren't worth a dime.";