.extension()

Method that returns the file extension of the file. The file extension is always lowercase and includes the dot. This method uses the function extension() for returning the file extension.

The method .extension() is located in the file file.jsxinc.

Usage

var myfile = new File("C:/myfile.txt");
var extension = myfile.extension();

Parameters

This method has no parameters.

Return values

Value Meaning
extension The extension of the file, such as .txt.