Re: Trim space chars from start of line
Re: Trim space chars from start of line
- Subject: Re: Trim space chars from start of line
- From: Steve Mills <email@hidden>
- Date: Mon, 25 Jul 2011 16:17:07 -0500
On Jul 25, 2011, at 16:10:38, Zavatone, Alex wrote:
> Awesome idea, and I would have thought it would have been faster, but with my original script taking 20 seconds, this takes 26.
That's strange. How much text are you feeding it and how many leading spaces are there?
> I did learn something amazing though.
> return text (i) thru -1 of t
> is MUCH faster than
> return characters (i) thru num of t.
>
> It's 26 vs 49 seconds.
>
> What is your line doing?
It works on a hunk of text as a whole "object" rather than a list of characters. Or are you asking about the -1? That's way of specifying how many items/characters from the end of a list/string you want. -1 is the last, -2 is the 2nd to the last, etc. You let AppleScript do the counting internally instead of you having to supply a variable for the length of the object.
--
Steve Mills
Drummer, Mac geek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden