Re: Strip characters without recursive loop
Re: Strip characters without recursive loop
- Subject: Re: Strip characters without recursive loop
- From: David Hood <email@hidden>
- Date: Tue, 19 Aug 2003 20:10:37 +1200
On Tuesday, August 19, 2003, at 01:52 PM, Duncan Cowan wrote:
Is it possible to string all non numerical characters from a string,
without
looping through each character?
I realise that this is probably not possible.... but it would make my
script
run a lot quicker.
Example:
set theString to "1234-56abc"
set theResult to characters of the string whose kind is integer
well, I don't know if it's faster than your particular loop but
set theString to "1234-56abc"
set theStringVersion2 to quoted form of theString
set shellstring to "echo " & theStringVersion2 & " |sed
's/[^0123456789]//g'"
set theResult to do shell script shellstring
seems to work,
David Hood
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.