name

@get:JvmName(name = "nameOf")
val File.name: String(source)

The name of the file or directory. The last segment of the path.

e.g.

assertEquals("world", "hello/world".toFile().name)