REBOL Programming/suffix?

From Wikibooks, open books for an open world
< REBOL Programming
Jump to: navigation, search

USAGE:[edit]

SUFFIX? path 

DESCRIPTION:[edit]

Return the suffix (ext) of a filename or url, else NONE.

SUFFIX? is a function value.

ARGUMENTS[edit]

  • path -- (Type: any-string)

SOURCE CODE[edit]

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]
]