• 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 leading and railing blanks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing leading and railing blanks


  • Subject: Re: Removing leading and railing blanks
  • From: Tim Mansour <email@hidden>
  • Date: Wed, 26 Feb 2003 11:08:24 +1100

What's the most efficient way to remove leading and trailing blanks from a string?

Jeff

As well as the other solutions posted, might I also suggest the use of regular expressions?

For instance, using the "change" command from the free Satimage scripting addition (http://www.satimage-software.com/) you could write:

set theText to change "^ +" into "" in theText regexp true -- removes leading blanks
set theText to change " +$" into "" in theText regexp true -- removes trailing blanks

Satimage is available for both OS 9 and X. If you're just using OS 9, you could also try the RegEx Commands scripting addition.

____________________________________________
Tim Mansour <email@hidden>
_______________________________________________
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: Removing leading and railing blanks (From: Paul Skinner <email@hidden>)

  • Prev by Date: Re: settle! was Re: Scripting Mail:get selection
  • Next by Date: VicomSoft FTP Client
  • Previous by thread: Re: Removing leading and railing blanks
  • Next by thread: Re: Removing leading and railing blanks
  • Index(es):
    • Date
    • Thread