← Docs
kotlin-stdlib / kotlin.io / java.io.File / startsWith

startsWith

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

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.

Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Supported and developed by JetBrains .
Kotlin™ is protected under the Kotlin Foundation
and licensed under the Apache 2 license .