root

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

Return Value

Type: auto

The root of the path p.

Examples

assertEqual(WindowsPath("").root, "");
assertEqual(PosixPath("").root, "");
assertEqual(WindowsPath("C:/Hello/World").root, "C:");
assertEqual(WindowsPath("/Hello/World").root, "");
assertEqual(PosixPath("/hello/world").root, "/");
assertEqual(PosixPath("C:/hello/world").root, "");

Meta