• 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 trailing spaces
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing trailing spaces


  • Subject: Re: Removing trailing spaces
  • From: Paul Berkowitz <email@hidden>
  • Date: Mon, 10 Jun 2002 21:55:10 -0700

On 6/10/02 9:47 PM, "webguide" <email@hidden> wrote:

> G'day all,
>
> I have the need to remove trailing spaces from a variable in an OSX script.
>
> Eg. Say myvariable is "2345-t ", it needs to be trimmed to just "2345-t"
>
> In OS9 I was using acme script widgets but I'm looking for a vanilla way of
> doing this in OSX.
>
pretty basic, as vanilla as it gets:

repeat while theString ends with " "
try
set theString to text 1 thru -2 of theString
on error -- if just " ", no text -2
set theString to ""
end try
end repeat



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

  • Follow-Ups:
    • Re: Removing trailing spaces
      • From: webguide <email@hidden>
References: 
 >Removing trailing spaces (From: webguide <email@hidden>)

  • Prev by Date: Re: applescript and graphics programs
  • Next by Date: Re: Removing trailing spaces
  • Previous by thread: Removing trailing spaces
  • Next by thread: Re: Removing trailing spaces
  • Index(es):
    • Date
    • Thread