Sender: |
|
Date: |
Thu, 20 Jan 2011 09:48:19 -0500 |
Reply-To: |
|
Subject: |
|
MIME-Version: |
1.0 |
Content-Transfer-Encoding: |
quoted-printable |
In-Reply-To: |
|
Content-Type: |
text/plain; charset=UTF-8 |
From: |
|
Parts/Attachments: |
|
|
On Thu, Jan 20, 2011 at 9:41 AM, Claudio Braga <[log in to unmask]> wrote:
> Il giorno 20/gen/2011, alle ore 15.33, Mark J. Reed ha scritto:
>
>>
>> set text item delimiters to "."
>> set bareName to text items 1 through -2 of theName as text
>>
>> The only flaw I see in this approach is that it doesn't elevate the
>> idea of "name extension" into an abstraction that sits above the idea
>> of "part of a string after a period". And I'm not sure how valuable
>> such an abstraction is anyway.
>>
>
> I guess this will not work for a file with multiple "." in the name. I'll stick with the previous solution
No, it will absolutely work for a file with multiple periods in the
name, which is why I did "text items 1 through -2" instead of just
"text item 1".
set text item delimiters to "."
text items 1 through -2 of "foo.x.y"
That returns "foo.x" - the same result you get from the other
approach, since the name extension of "foo.x.y" is "y", not "x.y".
>
> Thank you
>
>
> Regards
>
>
> Claudio Braga
> **********************
> Brescia - Cuneo
> [log in to unmask]
> **********************
>
--
Mark J. Reed <[log in to unmask]>
|
|
|