Created
May 14, 2022 13:58
-
-
Save enginebai/ea29f6425317eb6982ad5c34263c0aa1 to your computer and use it in GitHub Desktop.
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
class Version { | |
var major: Int? | |
var minor: Int? | |
var patch: Int? | |
fun String.toVersion(): Version? { | |
val split = this.split(".") | |
return Version(split[0].toInt(), split[1].toInt(), split[2].toInt()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment