startsWith

fun File.startsWith(other: File): Boolean (source)

Platform and version requirements: JVM

fun File.startsWith(other: String): Boolean (source)

Platform and version requirements: JVM

Determines whether this file belongs to the same root as other and starts with all components of other in the same order. So if other has N components, first N components of this must be the same as in other.

Return true if this path starts with other path, false otherwise.