• 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: "Arthur J. Knapp" <email@hidden>
  • Date: Fri, 14 Jun 2002 11:04:07 -0400

> Date: Tue, 11 Jun 2002 14:47:06 +1000
> Subject: Removing trailing spaces
> From: webguide <email@hidden>

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

on TrimSpaceRight(str)
tell (str)
set i to length
repeat while (i > 0) and (item i = space)
set i to i - 1
end repeat
if (i = 0) then
return ""
else
return text 1 thru i
end if
end tell
end TrimSpaceRight
_______________________________________________
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: Applescript, Soap and WO
  • Next by Date: Re: applescript and graphics programs
  • Previous by thread: Applescript, Soap and WO
  • Next by thread: Shell script installer? Or primer?
  • Index(es):
    • Date
    • Thread