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: "Zavatone, Alex" <email@hidden>
- Date: Mon, 25 Jul 2011 14:30:05 -0700
- Acceptlanguage: en-US
- Thread-topic: Trim space chars from start of line
On Jul 25, 2011, at 4:17 PM, Steve Mills wrote:
> 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?
The text I'm feeding it is < 80 characters and there may be up to 38 leading space characters. Generally though, there are are about 6
If there were a way to get the offset position of the first non space character, that would seem ideal to use with your method.
>> 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.
This email message and any attachments are for the sole use of the intended recipient(s) and may contain information that is proprietary to U.S. Foodservice, Inc and/or its subsidiaries or otherwise confidential or legally privileged. If you have received this message in error, please notify the sender by reply, and delete all copies of this message and any attachments. If you are the intended recipient you may use the information contained in this message and any files attached to this message only as authorized by U.S. Foodservice. Files attached to this message may only be transmitted using secure systems and appropriate means of encryption, and must be secured using the same level password and security protection with which the file was provided to you. Any unauthorized use, dissemination or disclosure of this message or it's attachments is strictly prohibited.
_______________________________________________
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