Re: Removing leading and railing blanks
Re: Removing leading and railing blanks
- Subject: Re: Removing leading and railing blanks
- From: Michael Terry <email@hidden>
- Date: Wed, 26 Feb 2003 10:06:02 -0800
On 2/25/03 5:07 PM, "Michael Terry" <email@hidden> wrote:
Oops, my last handler had a bunch of extra stuff it didn't need (thanks,
"al"). Removing it produces:
on chomp(str)
set n to str's {text 1 thru word 1, text -1 thru word -1}
set AppleScript's text item delimiters to space
set n to {n's front's text items, n's end's text items}
set n to {n's front's rest's length, n's end's rest's length}
text ((n's front) + 1) thru -((n's end) + 1) of str
end chomp
and makes it pretty fast.
Mike
_______________________________________________
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.