Re: Tidying a string
Re: Tidying a string
- Subject: Re: Tidying a string
- From: "Marc Rubin" <email@hidden>
- Date: Thu, 28 Apr 2005 13:59:06 -0400
>on 28/4/05 18:19, Marc Rubin at email@hidden wrote:
>
>>> I'd like to strip all
>>> unnecessary spaces and get "foo bar foo bar foo bar".
>>
>> is it considered 'vanilla' enough to script the shell to use grep to
>> replace:
>>
>> "^ +" with ""
>>
>> " +$" with "".
>>
>> " +" with " "
>
>That's far too fruity!
>
>How about this for *vanilla shell*:
>
>
>set t to " foo bar foo bar foo bar "
>do shell script "echo " & t & " | tr ' ' ' '"
>
>-->"foo bar foo bar foo bar"
>
>:-)
>
>--
>Martin Orpen
very salty!
mightn't that leave single spaces at the beginning and end?
don't have a machine here to test, but
does it replace four spaces with one,
or with two instances of one?
marc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden