Re: Removing trailing spaces
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.