parts

parts
(
PathType
)
(
auto ref in PathType p
)
if (
isSomePath!PathType
)

Return Value

Type: auto

The parts of the path as an array.

Examples

1 assertEqual(Path().parts, ["."]);
2 assertEqual(Path("./.").parts, ["."]);
3 
4 assertEqual(WindowsPath("C:/hello/world").parts, ["C:", "hello", "world"]);
5 assertEqual(WindowsPath(`hello/.\world.exe.xml`).parts, ["hello", "world.exe.xml"]);
6 assertEqual(WindowsPath("C:/hello/world.exe.xml").parts, ["C:", "hello", "world.exe.xml"]);
7 
8 assertEqual(PosixPath("hello/world.exe.xml").parts, ["hello", "world.exe.xml"]);
9 assertEqual(PosixPath("/hello/.//world.exe.xml").parts, ["/", "hello", "world.exe.xml"]);
10 assertEqual(PosixPath("/hello\\ world.exe.xml").parts, ["/", "hello\\ world.exe.xml"]);

Meta