• 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: Bill Cheeseman <email@hidden>
  • Date: Fri, 27 Apr 2001 18:30:30 -0400

on 4/27/01 4:40 PM, Richard 23 at email@hidden wrote:

> I would guess that concatenating strings would be faster since there's no
> overhead as far as list/vector structures are concerned.

Well, string operations still have to work as arrays/lists/vectors/something
under the hood. But that's what I've found today, trying to better the
efficiency of my original technique (with your enhancement) for extracting
digits from a string. In my testing, concatenating strings remains a little
less than 5% faster than Paul Berkowitz's technique using the "end of"
syntax on a list. I haven't been able to find anything faster, at least for
short input strings like phone numbers.

I even tried a couple of tricks based on foreknowledge that the output
string for an area code and telephone number has to be 10 characters long,
but I couldn't find anything faster.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA

The AppleScript Sourcebook - www.AppleScriptSourcebook.com
Vermont Recipes - www.stepwise.com/Articles/VermontRecipes


  • Follow-Ups:
    • Re: How best to extract digits from a string?
      • From: Paul Skinner <email@hidden>
References: 
 >Re: How best to extract digits from a string? (From: Richard 23 <email@hidden>)

  • Prev by Date: Mike Mortin is out of the office.
  • Next by Date: Importing a Folder full of Media Files
  • 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