kotlin 集合

    var list1 = listOf(1, 3, 5)
    //
    println(list1.map { it * 10 })//[10, 30, 50]
    //筛选list
    println(list1.filter { it>3 }) //[5]
    //筛选list 后的个数
    print(list1.count{it>3}) //1

猜你喜欢

转载自www.cnblogs.com/buchizaodian/p/12642129.html