All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.ru.casperix.atlas.PathUtil.kt Maven / Gradle / Ivy

The newest version!
package ru.casperix.atlas

/**
 * Temp class, before fix "kotlin.io.path.Path" miss-error
 */
object PathUtil {
    val separator = '/'
    fun pathParent(value: String): String? {
        val sep = value.replace('\\', separator)

        val index = sep.lastIndexOf(separator)
        if (index == -1) return null

        return sep.slice(0 until index)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy