vl-filename-extension

(vl-filename-extension filename)

The vl-filename-extension function extracts the extension from a file specification.

Arguments

filename specifies a file name including the extension and probably path (as text string).

Note: The function does not check whether the specified file exists.

Return Value

The function returns the extension of the file as text string which begins with a period (.).

The function returns nil, If the file specification does not contain an extension.

Examples

: (vl-filename-extension "d:\\myproject\\my.lsp")

".lsp"

: (vl-filename-extension "my.lsp")

".lsp"

: (vl-filename-extension "my")

nil