Re: Removing every instance of a substring
Re: Removing every instance of a substring
- Subject: Re: Removing every instance of a substring
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 14 Jan 2003 13:11:13 -0800
On 1/14/03 12:04 PM, "Gnarlodious" <email@hidden> wrote:
>
Does anyone have a handler kicking around that will remove every instance of
>
a substring from a string?
>
For example:
>
"Gnarlodious.util:Workshop.util:Forth.util:Mops.util:MopsManual.util:"
>
>
Will morph into:
>
"Gnarlodious:Workshop:Forth:Mops:MopsManual:"
>
>
with removing substring ".util"
What's wrong with the usual way?
set AppleScript's text item delimiters to {".util"}
set textItems to text items of theString
set AppleScript's text item delimiters to {""}
set theString to textItems as string
?
You may need to make allowances for strings with more than 4000 text items.
(Actually I hit the problem with only 3992 text items yesterday. More
later.) I can supply one if you need it.
--
Paul Berkowitz
_______________________________________________
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.