2018.10.22 var str = "kotlin" var result = str.takeIf { it.startsWith("ko") } println("result = $result") result = str.takeUnless { it.startsWith("ko") } println("result = $result") repeat(5){ println("This is the ${it+1} time, the index is $it") }