getExtension

open fun getExtension(filename: String): String

Returns the extension (i.e. the part after the last ".") of a file.

Will return an empty string if the file name doesn't contain any dots. Only the last segment of a the file name is consulted - i.e. all leading directories of the filename parameter are skipped.

Return

the extension of filename

Parameters

filename

the name of the file to obtain the extension of.