let numberList = [11,12,13,14,15,16] for item in numberList{ print(item) } for item in numberList.enumerated(){ print(item.offset,item.element) } for (index,item) in numberList.enumerated().reversed() { print(index,item) } for i in 0..<5 { print("--",numberList[i]) } for i in 0...5{ print("==",i) } for i in (0...5).filter({ i in i % 2 == 1}) { print("***",i) } for i in (0...5).filter({ $0 > 2}) { print("###",i) }
赠送一种数组截取方式
array(groups![startIndex...endIndex])原文链接:https://www.f2er.com/swift/322638.html