Created
July 7, 2017 04:56
-
-
Save AkshayChordiya/eddd4ac0fc3d557852f0a1a8d1a51cdb to your computer and use it in GitHub Desktop.
Example of takeUnless function in Kotlin
This file contains hidden or 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 index = "Kotlin".indexOf('K').takeUnless { it < 0 } ?: 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment