Re: Search and Replace in String
Re: Search and Replace in String
- Subject: Re: Search and Replace in String
- From: Brian Christmas <email@hidden>
- Date: Sun, 18 Jul 2010 13:49:53 +1000
G'day Jon
This doesn't compile
on deleteString(aString) --> string
set foo to offset of aString in theString
if foo 0 then
set theString to beforeString(aString) & afterString(aString) as string
end if
return theString
end deleteString
it should be
on deleteString(aString) --> string set foo to offset of aString in theString if foo ≠ 0 then set theString to beforeString(aString) & afterString(aString) as string end if return theString end deleteString
Regards
Santa
On 18/07/2010, at 1:46 AM, Jon Pugh wrote: At 2:58 PM +0200 7/17/10, André Renault wrote: I discovered a hack to search and replace inside a string. It involves using text item delimiters to do the job.
I'd like to once again mention my SmartString class which does this and lots more, in a simple to use package: http://www.seanet.com/~jonpugh/software/SmartString.applescriptNote that you may need to set your browser to MacRoman before copying and pasting the page in order to get all the extended characters (downloading it via the contextual menu from my main page http://www.seanet.com/~jonpugh/ generally works better). If you get compile errors, that's the reason. Jon
And what, you ask, was the beginning of it all? And it is this...... Existence that multiplied itself For sheer delight of being And plunged with numberless trillions of forms So that it might find itself innumerably
Sri Aurobindo
|
_______________________________________________
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