I have an array containing a number of strings. I have used contains() (see below) to check if a certain string exists in the array however I would like to chec
contains()
If you are just checking if an item exists in a specific array, try this:
var a = [1,2,3,4,5] if a.contains(4) { print("Yes, it does contain number 4") } else { print("No, it doesn't") }