2015-08-15 39 views

回答

0

依賴於迅速的版本...在1.2:

var array = ["led","zepp","jimmy","page"] 
    if find(array, "jimmy") != nil { 
     println("yay") 
    } 

斯威夫特2

var array = ["led","zepp","jimmy","page"] 
    if array.indexOf("jimmy") != nil { 
     print("yay") 
    } 
相關問題