Declaration:
let listArray = [\"kashif\"] let word = \"kashif\"
then this
contains(listArray, word)
Ret
swift 5, swift 4.2 , use the code in the below.
let list = ["kAshif"] let word = "Kashif" if list.contains(where: { $0.caseInsensitiveCompare(word) == .orderedSame }) { print("contains is true") }