• 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: Removing leading and railing blanks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Removing leading and railing blanks (From: Michael Terry <email@hidden>)

  • Prev by Date: Re: Safari - Clear History Cache
  • Next by Date: Re: Safari - Clear History Cache
  • Previous by thread: Re: Removing leading and railing blanks
  • Next by thread: Re: Removing leading and railing blanks
  • Index(es):
    • Date
    • Thread