In Swift, how can I check if an element exists in an array? Xcode does not have any suggestions for contain, include, or has, and a qu
contain
include
has
if user find particular array elements then use below code same as integer value.
var arrelemnts = ["sachin", "test", "test1", "test3"] if arrelemnts.contains("test"){ print("found") }else{ print("not found") }