W3cubDocs

/Kotlin

endsWith

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

Determines whether this file path ends with the path of other file.

If other is rooted path it must be equal to this. If other is relative path then last N components of this must be the same as all components in other, where N is the number of components in other.

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

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

Determines whether this file belongs to the same root as other and ends with all components of other in the same order. So if other has N components, last N components of this must be the same as in other. For relative other, this can belong to any root.

Return true if this path ends 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/ends-with.html