Last active
August 21, 2021 12:37
-
-
Save magdamiu/083d203e88961abe2f6d3861f6e980a0 to your computer and use it in GitHub Desktop.
Clean Code with Kotlin by Magda Miu - Meaningful names 1 - Unclean Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class GetFile(val d: String, val n: String) | |
val pattern = Regex("(.+)/([^/]*)") | |
fun files(ph: String): PathParts { | |
val match = pattern.matchEntire(ph) | |
?: return PathParts("", ph) | |
return PathParts(match.groupValues[1], | |
match.groupValues[2]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment