Last active
November 13, 2018 12:59
-
-
Save stasimus/81e007b25bc034eb838f5935c382c088 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
val p1: String? = null | |
val p2: String? = "p2" | |
assertNull(concat2(p1, p2)) | |
/* Almost ternary operator */ | |
fun concat2(arg1: String?, arg2: String?): String? { | |
return if (arg1 != null && arg2 != null) arg1 + arg2 else null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment