parts

parts
(
PathType
)
(
auto ref in PathType p
)

Return Value

Type: auto

The parts of the path as an array.

Examples

assertEqual(Path().parts, ["."]);
assertEqual(Path("./.").parts, ["."]);
assertEqual(WindowsPath("hello/world.exe.xml").parts, ["hello", "world.exe.xml"]);
assertEqual(WindowsPath("C:/hello/world.exe.xml").parts, [`C:\`, "hello", "world.exe.xml"]);
assertEqual(PosixPath("hello/world.exe.xml").parts, ["hello", "world.exe.xml"]);
assertEqual(PosixPath("/hello/world.exe.xml").parts, ["/", "hello", "world.exe.xml"]);

Meta