• 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: Search and Replace in String
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.applescript

Note 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

  • Follow-Ups:
    • Re: Search and Replace in String
      • From: Jon Pugh <email@hidden>
References: 
 >Search and Replace in String (From: André Renault <email@hidden>)
 >Re: Search and Replace in String (From: Jon Pugh <email@hidden>)

  • Prev by Date: Re: Search and Replace in String
  • Next by Date: Re: Search and Replace in String
  • Previous by thread: Re: Search and Replace in String
  • Next by thread: Re: Search and Replace in String
  • Index(es):
    • Date
    • Thread