「Swift」配列の要素を変更するサンプル
サンプルコード
var cityArr = ["Tokyo", "Oosaka", "Fukuoka"] cityArr[1] = "Nagoya" cityArr[2] = "Yokohama" print(cityArr[1]) print(cityArr[2])
Coding Changes the World
サンプルコード
var cityArr = ["Tokyo", "Oosaka", "Fukuoka"] cityArr[1] = "Nagoya" cityArr[2] = "Yokohama" print(cityArr[1]) print(cityArr[2])