File.extension
The File.extension property returns a string representing the extension of the File, including the "." character.
Example
local file = sys.File("doc\\test.txt") -- outputs ".txt" print("file.extension: "..file.extension)