Product Site

5.4.8.18. extension

Returns the file's extension, the portion of the file name after the last dot. Returns the null string if the file name contains only one dot that is its first character.

See also method name.

Example 5.253. File class — extension method
say .File~new("/usr/local/lib/rexx.img")~extension    -- img
say .File~new("c:\windows")~extension                 -- ""
say .File~new(".config")~extension                    -- ""