Mojo function
split
split[PathLike: PathLike, //](path: PathLike) -> Tuple[String, String]
Split a given pathname into two components: head and tail. This is useful for separating the directory path from the filename. If the input path ends with a separator, the tail component will be empty. If there is no separator in the path, the head component will be empty, and the entire path will be considered the tail. Trailing separators in the head are stripped unless the head is the root directory.
Parameters:
- βPathLike (
PathLike
): The type conforming to the os.PathLike trait.
Args:
- βpath (
PathLike
): The path to be split.
Returns:
A tuple containing two strings: (head, tail).
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
π What went wrong?