我想用第二个位置的索引值开始一个 for in 循环(使用元组)。
myArray = [9,1,8,2,7,3,7,94,5]
for (index, element) in myArray.enumerate(){
}
我怎样才能在数组的第二个位置开始它? (具有索引 1 和元素 1)
最佳答案
也许吧?
myArray = [9,1,8,2,7,3,7,94,5]
for (index, element) in myArray.enumerate() where index > 0 {
}
关于arrays - 在 Swift 2.0 中有没有一种方法可以从数组的某个索引开始一个 tuple-for-loop?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36041793/