Function: f-ext
f-ext is a for file-name-extension, defined in
files.el.gz.
Signature
(f-ext FILENAME &optional PERIOD)
Documentation
Return FILENAME's final "extension".
The extension, in a file name, is the part that begins with the last .,
excluding version numbers and backup suffixes, except that a leading .
of the file name, if there is one, doesn't count.
Return nil for extensionless file names such as foo.
Return the empty string for file names such as foo..
By default, the returned value excludes the period that starts the extension, but if the optional argument PERIOD is non-nil, the period is included in the value, and in that case, if FILENAME has no extension, the value is "".
Other relevant functions are documented in the f group.
Shortdoc
;; f
(f-ext "path/to/file")
=> nil
(f-ext "path/to/file.txt")
=> "txt"
(f-ext "path/to/file.txt.org")
=> "org"