Scope Function with Lambda Receiver (With)

Run Settings
LanguageKotlin
Language Version
Run Command
fun main(args : Array<String>){ //withTwo() withOne() } fun withOne(){ val message = "Hello Kotlin!" val result = with(message){ println("value is $this") println("with length ${this.length}") } } fun withTwo(){ val message = "Hello Kotlin!" val result = with(message){ "First character is ${this[0]}" + " and last character is ${this[this.length - 1]}" } println(result) }
Editor Settings
Theme
Key bindings
Full width
Lines