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