Re: Simple substring help
Re: Simple substring help
- Subject: Re: Simple substring help
- From: Christopher Stone <email@hidden>
- Date: Fri, 5 Dec 2003 11:45:17 -0600
At 11:06 -0600 12/05/2003, Wade Williams wrought:
set string1 to "MyHD:Folder:SubFolder:File:"
what's the easiest way to accomplish chopping off the "File:" at the end?
______________________________________________________________________
Hello Wade,
This process is far less than intuitive:
set string1 to "MyHD:Folder:SubFolder:File:"
set AppleScript's text item delimiters to {":"}
set ti to (text items of string1)
set newString to ((text items 1 thru -3 of string1) & "") as string
set AppleScript's Text Item Delimiters to {""}
Personally I prefer to use the Satimage osax for such things:
set string1 to "MyHD:Folder:SubFolder:File:"
set newString to change "[^:]+:$" into "" in string1 with regexp without
case sensitive
--> MyHD:Folder:SubFolder:
Satimage osax (freeware): <
http://www.satimage.fr/software/en/softx.html>
Chris
_______________________________________________
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.