fun middlefun(){
val train = “北京” to “上海”
var t = “北京”.to(“上海”)
println(train)
println(t)
var trait2 = "北京" 到 "上海"
var traint = "".到("")
}
infix fun String.到(other:String):String {
return this+other//自定义中缀函数
}
fun funnumber(){//函数字面量
“hellp”
println(“work”)
val printHello = {println(“hello”)}
println(printHello)
val prinMsg = {msg:String -> println(msg)}
fun prinMsg(msg:String){
println(msg)
}
prinMsg("kotlin 很有趣")
}