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: Richard 23 <email@hidden>
- Date: Thu, 26 Apr 2001 04:59:26 -0700
>
So now I filter for numerical digits as in this example:
>
>
set digits to "1234567890"
>
set input to "(800) 555-1212"
>
set output to "" -- initialize
>
repeat with char in every character of input
>
if char is in digits then set output to output & char
>
end repeat
>
get output --> "8005551212"
>
>
Is there a more efficient way to do this?
I can't think of one although I'd change the repeat statement to
repeat with char in input
R23