Assume we have an array of optionals defined:
var arrayOfOptionals: [String?] = [\"Seems\", \"like\", \"an\", nil, \"of\", \"optionals\"]
I
How about:
import Foundation var test: [String!] = ["this","is","a",nil,"test"] for string in test { if string != nil { print(string) } }
Output is thisisatest.
thisisatest
In your case use [String!], if I understood you correctly.
[String!]