startsWith

Platform and version requirements: JVM (1.0)
fun File.startsWith(other: File): Boolean
fun File.startsWith(other: String): Boolean

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.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/java.io.-file/starts-with.html