Skip to content

Instantly share code, notes, and snippets.

@Audhil
Created February 27, 2020 07:39
Show Gist options
  • Save Audhil/8b9ee912b8f855b4ee3486e628bd1ad5 to your computer and use it in GitHub Desktop.
Save Audhil/8b9ee912b8f855b4ee3486e628bd1ad5 to your computer and use it in GitHub Desktop.
kotlin scope function
fun main() {
val valueIs = "Jack and jill went up the hill!"
val result = valueIs.run {
this.contains("help")
}
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