Skip to content

Instantly share code, notes, and snippets.

@renaudcerrato
Last active February 9, 2019 08:06
Show Gist options
  • Save renaudcerrato/ed4c6e9452ab198d949e86d92feccf41 to your computer and use it in GitHub Desktop.
Save renaudcerrato/ed4c6e9452ab198d949e86d92feccf41 to your computer and use it in GitHub Desktop.
Kotlin with/apply
val s = with(StringBuilder()) {
append("Hello!")
append("How are you?")
toString() // implicit return value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment