klyn.io.Path.startsWith
method

    public startsWith(base as Object) as Boolean:

Description

Returns `true` when this path starts with the same complete path components as the supplied base path.

Both operands are converted to normalized absolute paths before the comparison. On Windows, path component case is ignored. A textual sibling such as `/tmp/base-other` therefore does not start with `/tmp/base`.

Parameters

Parameter | Description
--- | ---
`base` | Base path supplied as a `Path`, `String`, or path-like object.

Returns

True when every component of `base` is a leading component of this path.

Example

    import klyn.io

    base = FolderPath("/tmp/base")
    assert FilePath(base, "file.txt").startsWith(base)
    assert not FilePath("/tmp/base-other/file.txt").startsWith(base)