• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A Replace() function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >A Replace() function (From: Emile Schwarz <email@hidden>)

  • Prev by Date: A Replace() function
  • Next by Date: Re: Libraries and effiency
  • Previous by thread: A Replace() function
  • Next by thread: Remember Finder windows left open at shutdown
  • Index(es):
    • Date
    • Thread