Re: How best to extract digits from a string?
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: Thu, 26 Apr 2001 06:14:16 -0400
on 4/25/01 11:46 PM, Paul Berkowitz at email@hidden wrote:
>
repeat with i from 1 to (count input)
>
set char to character i of input
>
if char is in digits then set end of output to char
>
end repeat
Do you say this is better than concatenating strings on the basis of testing
or theory?
I understand that the "end of" syntax was provided as a speedier way of
building lists than concatenating them. (The old AppleScript 1.1 release
notes regarding the differences between linked lists and vector lists make
fascinating if difficult reading.)
But I don't know anything about how strings are implemented under the hood,
and I wonder whether the list approach in general is faster or slower than
concatenating strings.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
The AppleScript Sourcebook - www.AppleScriptSourcebook.com
Vermont Recipes - www.stepwise.com/Articles/VermontRecipes