basename

abstract fun basename(path: String, suffix: String = definedExternally): String(source)

Return the last portion of a path. Similar to the Unix basename command. Often used to extract the file name from a fully qualified path.

Parameters

path

the path to evaluate.

suffix

optionally, an extension to remove from the result.

Throws

{TypeError} if path is not a string or if ext is given and is not a string.