commonMain.ru.casperix.atlas.PathUtil.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spine Show documentation
Show all versions of spine Show documentation
Signals for all occasions
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)
}
}