ReferenceFilesystem

getfileextension

Returns a path's extension without the dot. Only the last path segment is examined, so a dot in a folder name does not count, and a name without a dot gives an empty string.

Syntax

getfileextension(path: string) -> string

Parameters

ParameterTypeDescription
pathstringA file path.

Returns

TypeDescription
stringThe text after the last dot of the last path segment, or an empty string.

Example

print(getfileextension("folder/file.txt"))

These are Game executor contracts. Check build requirements and session lifetimes before using them.