Skip to content

Instantly share code, notes, and snippets.

@mahdyadi
Last active April 20, 2020 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahdyadi/bca4dcbb35db4f6586248730f1d908d0 to your computer and use it in GitHub Desktop.
Save mahdyadi/bca4dcbb35db4f6586248730f1d908d0 to your computer and use it in GitHub Desktop.
fun operate(subject: String, action: (String) -> String) {
val acted = action(subject)
println(acted)
}
operate("foo"){
"$it bar"
} //foo bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment