Re: Strip characters without recursive loop
Re: Strip characters without recursive loop
- Subject: Re: Strip characters without recursive loop
- From: Jean-Baptiste LE STANG <email@hidden>
- Date: Tue, 19 Aug 2003 10:20:10 +0200
Using satimage osax, you can do :
change "[^(1-9)]" into "" in "aze213aze456" with regexp
--> "213456"
@+ JB
Le mardi, 19 ao{ 2003, ` 10:10 Europe/Paris, David Hood a icrit :
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.
_______________________________________________
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.