Mojo function
basename
basename[PathLike: PathLike, //](path: PathLike) -> String
Returns the tail section of a path.
basename("a/path/foo.txt") # returns "foo.txt"
basename("a/path/foo.txt") # returns "foo.txt"
Parameters:
- PathLike (
PathLike
): The type conforming to the os.PathLike trait.
Args:
- path (
PathLike
): The path to retrieve the basename from.
Returns:
The basename from the path.

Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!