core :: Path :: filename
to_s
var path = "/tmp/somefile".to_path assert path.filename == "somefile"
The result does not depend of the file system, thus is cached for efficiency.
# Short name of the file at `to_s` # # ~~~ # var path = "/tmp/somefile".to_path # assert path.filename == "somefile" # ~~~ # # The result does not depend of the file system, thus is cached for efficiency. var filename: String = path.basename is lazy