Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Clean Code with Kotlin by Magda Miu - Meaningful names 1 - Clean Code
data class PathParts(val directory: String, val fileName: String)
fun splitPath(path: String) =
PathParts(
path.substringBeforeLast('/', ""),
path.substringAfterLast('/'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment