root

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

Return Value

Type: auto

The root of the path p.

Examples

1 assertEqual(WindowsPath("").root, "");
2 assertEqual(PosixPath("").root, "");
3 assertEqual(WindowsPath("C:/Hello/World").root, "C:");
4 assertEqual(WindowsPath("/Hello/World").root, "");
5 assertEqual(PosixPath("/hello/world").root, "/");
6 assertEqual(PosixPath("C:/hello/world").root, "");

Meta