[REBOL] Re: truble with " * " all characters recognizing
From: al:bri:xtra at: 11-Dec-2002 10:29
Gregg wrote:
> If you're using an older release, that doesn't have SUFFIX?, here's the
source for it.
> >> source suffix?
> suffix?: func [
> {Return the suffix (ext) of a filename or url, else NONE.}
> path [any-string!]
> ][
> if all [
> path: find/last path #"."
> not find path #"/"
> ] [to-file path]
> ]
Here's a slightly smaller version of 'suffix? that I use:
>> source suffix?
suffix?: func [
{Return the extension of a path as a file!, else none.}
Path [file! url!]
][
all [
Path: find/last Path #"."
not find Path #"/"
to-file Path
]
]
I also use 'extension? as an alternative word for this. Like:
extension?: :suffix?
I hope that helps!
Andrew Martin
ICQ: 26227169 http://valley.150m.com/