存在任何元件以與陣列作爲任何對象:如果a是字符串/ int數組,但這是任何數組檢查陣列中夫特
var a : [Any] = []
let x : String = "This is X"
let y : Int = 9
let z : [Any] = ["1", "no. 2"]
a.append(x)
a.append(y)
a.append(z)
let ele1 = 9
let ele2 = "This is test string"
很簡單! 如何檢查ele1,ele2是否存在或不在?
OK,完成。謝謝 –