Re: Trim?
Re: Trim?
- Subject: Re: Trim?
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 03 Aug 2002 08:48:20 -0700
On 8/3/02 6:24 AM, "Nigel Garvey" <email@hidden>
wrote:
>
The following effort covers all the eventualities, as far as I can see:
>
>
set s to " email@hidden 'This is a > string?' "
>
>
set AppleScript's text item delimiters to {space}
>
set l to s's text items
>
set AppleScript's text item delimiters to {""}
>
>
-- Prepend a space to every non-blank text item except the first
>
set started to false
>
repeat with thisItem in l
>
if (count thisItem) > 0 then
>
if started then
>
set thisItem's contents to (space & thisItem)
>
else
>
set started to true
>
end if
>
end if
>
end repeat
>
>
return l as string --> "email@hidden 'This is a > string?'"
Very good, Nigel.
--
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.
References: | |
| >Re: Trim? (From: Nigel Garvey <email@hidden>) |