• 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: How best to extract digits from a string?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How best to extract digits from a string?


  • Subject: Re: How best to extract digits from a string?
  • From: "Arthur J Knapp" <email@hidden>
  • Date: Thu, 26 Apr 2001 16:51:00 -0400

> Date: Thu, 26 Apr 2001 09:36:25 -0700
> Subject: Re: How best to extract digits from a string?
> From: Jed Verity <email@hidden>

> After running some simple benchmark tests, I found the concatenation method
> to be dramatically faster for strings. For example:
>
> --Concat Test:
> set str to ""
> repeat 5000 times
> set str to str & "a"
> end
>
> --List Test
> set str to {}
> repeat 5000 times
> set end of str to "a"

You're not going to believe this, but a very simple change
to the above will equalize List Test and Concat Test.

> end
> set applescript's text item delimiters to ""
> str as string

-- Variable Test
set str to {}
set aVar to "a" -- save literal to variable
repeat 5000 times
set end of str to aVar -- don't use literal
end repeat
str as string


-- Reference Test
set str to {}
set rstr to a reference to str
repeat 5000 times
set end of rstr to "a"
end repeat
str as string




Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden

Hey, check out:
<http://developer.apple.com/techpubs/macos8/InterproCom/AppleScriptScripters
/AppleScriptLangGuide/>


  • Prev by Date: Raw data in FileMaker Pro cells
  • Next by Date: Re: How best to extract digits from a string?
  • Previous by thread: Re: How best to extract digits from a string?
  • Next by thread: Re: How best to extract digits from a string?
  • Index(es):
    • Date
    • Thread