「Swift」forEachで配列(Array)の要素を取得するサンプル

方法1

let cftArr = ["A001", "B002", "C003", "D004","E005"]

for kk in cftArr {
    print(kk)
}

方法2

let cftArr = ["A001", "B002", "C003", "D004","E005"]

cftArr.forEach { gg in
    print(gg)
}

 

Swift

Posted by arkgame