• 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: Trim?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Move a sound file
  • Next by Date: Re: Trim?
  • Previous by thread: Re: Trim?
  • Next by thread: Re: Trim?
  • Index(es):
    • Date
    • Thread