Function Literals with Receivers


fun String.build(block: String.() -> Unit) : String { 
  return StringBuilder(this).apply(block).toString()
}



fun use() { 
  "".build { 
    append("34")
  }
}

Back Home Next