Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Kotlin test DSL
//Lambda without receiver
fun buildString (
builderAction: (StringBuilder) -> Unit
) : String {
val stringBuilder = StringBuilder()
return stringBuilder.toString()
val string = buildString {
it.append("Hello, ") // Note the need for adding 'it' in front
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment