• 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: Kai <email@hidden>
  • Date: Wed, 26 Feb 2003 01:23:23 +0000

on Tue, 25 Feb 2003 00:51:40 -0600, Jeffrey Mattox <email@hidden> wrote:

> What's the most efficient way to remove leading and trailing blanks
> from a string?

If by blanks you mean spaces, Jeffrey - try this:

========================================

to stripEndSpaces from t
repeat until t does not start with space
set t to t's text 2 thru -1
end repeat
repeat until t does not end with space
set t to t's text 1 thru -2
end repeat
t
end stripEndSpaces

stripEndSpaces from " date '+%B %e, %G' "
--> "date '+%B %e, %G'"

========================================

--
Kai
_______________________________________________
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.

  • Prev by Date: Re: Some date math
  • Next by Date: Re: open Applications' Dictionaries
  • Previous by thread: Re: Removing leading and railing blanks
  • Next by thread: Re: Removing leading and railing blanks
  • Index(es):
    • Date
    • Thread