endsWith

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

Platform and version requirements: JVM

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.

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

Platform and version requirements: JVM

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.