跳轉到內容

Rebol 程式設計/suffix?

來自華夏公益教科書,開放的書籍,開放的世界
SUFFIX? path 

返回檔名或 URL 的字尾(副檔名),否則返回 NONE。

SUFFIX? 是一個函式值。

  • path -- (型別: any-string)

原始碼

[編輯 | 編輯原始碼]
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]
]
華夏公益教科書