-1

How do i refer to an entire array when comparing 2 components.

    var array:[String] = ["red", "green", "blue", "yellow"]
    if textfield.text == array[]{

println("color good")
}

how do i check if the textfield is = any of the array components, not just a specific one?

1 Answers1

0
if contains(array, textfield.text) {
     ...
Dániel Nagy
  • 11,815
  • 9
  • 50
  • 58