OxL Reference

method Path.fileName

Last component (a/b.txt -> b.txt; / and the empty path -> empty).

Example:

oxl✓ checked in CI
use std.io { Path }

fn main() io {
  print(Path.of("/src/main.oxl").fileName())
}
Output
main.oxl
pub(api) fn fileName() -> str

Since. 1.0.0-beta

Returns

str

Effects

none declared (pure unless the body says otherwise)

Defined in: std/io/io.oxl:895

See also