relativeToOrSelf

JVM
JRE7
1.4
@ExperimentalPathApi fun Path.relativeToOrSelf(
    base: Path
): Path

Calculates the relative path for this path from a base path.

Note that the base path is treated as a directory. If this path matches the base path, then a Path with an empty path will be returned.

Return the relative path from base to this, or this if this and base paths have different roots.