Re: A Replace() function
Re: A Replace() function
- Subject: Re: A Replace() function
- From: KOENIG Yvan <email@hidden>
- Date: Wed, 18 Aug 2010 11:24:47 +0200
I apologilize for you English speaking users, but Émile is a French
old friend.
Bonjour Émile.
Ta boucle est peu efficace.
L'utilisation des Text Item delimiters l'est beaucoup plus.
--=====
(*
replaces every occurences of OldString by NewString in the text
SourceStr
*)
on remplace(SourceStr, OldString, NewString)
local oTIDs, l
set oTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to OldString
set l to text items of SourceStr
set AppleScript's text item delimiters to NewString
set NewSource to l as text
set AppleScript's text item delimiters to oTIDs
return NewSource
end remplace
--=====
Yvan (VALLAURIS, France) mercredi 18 août 2010 11:24:09
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden