Re: Removing leading and railing blanks
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.