• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Accessing lasts characters of a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Accessing lasts characters of a string (From: "John C. Welch" <email@hidden>)

  • Prev by Date: Re: Accessing lasts characters of a string
  • Next by Date: Re: Vexing POSIX file issue
  • Previous by thread: Re: Accessing lasts characters of a string
  • Next by thread: Prevent the appearance of the "Choose Application" dialog during compilation/execution
  • Index(es):
    • Date
    • Thread