ios swift截取数组(Arrays)

苹果官网文档:Arrays

        var arr = [1,2,3,4,5,6,7,8,9]
        let arr1 = arr[2...4]
        let arr2 = arr[2..<4]
        print(arr1)
        print(arr2)

打印结果:
[3, 4, 5]
[3, 4]

相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页