Created
February 27, 2020 09:55
-
-
Save Audhil/3fcff05971161f978967c0bea490859f to your computer and use it in GitHub Desktop.
kotlin scope function
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
fun main() { | |
val valueIs = "Jack and jill went up the hill!" | |
val result = with(valueIs) { | |
this.contains("yup") | |
} | |
println(valueIs) // o/p - Jack and jill went up the hill! | |
println(result) // o/p - false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment