Re: Accessing lasts characters of a string
Re: Accessing lasts characters of a string
- Subject: Re: Accessing lasts characters of a string
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 13 Mar 2008 09:41:51 -0700
- Thread-topic: Accessing lasts characters of a string
On 3/13/08 7:58 AM, "John C. Welch" <email@hidden> wrote:
> On 03/13/2008 09:28 AM, "Luther Fuller" <email@hidden> wrote:
>
>> One last comment ...
>>
>> repeat 100000 times
>> -- (rest of characters of strA) as text -- 46 sec
>> text 2 thru -1 of strA -- 4 sec
>> end repeat
>>
>> Using 'rest of characters of ...' seems to be way slow!
>
> Depends on how you use it. I've yet to see where I need to use it 100K times
> in a script, and for ease of coding and maintenance, it's far more elegant
> than parsing the strings or repeating through them.
...but both slower and less straightforward than
text 2 thru end of
or
text 2 thru -1 of
Why make lists and have to deal with tids and coerce back to text when it's
not necessary and is more roundabout? 'text x thru y' when dealing with text
is fastest and simplest. There's certainly more than one way to do it, and
any of them will do, but Occam's razor is a pretty good principle for both
clarity and efficiency.
--
Paul Berkowitz
_______________________________________________
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