indexing - swift : I try to make searching window.. what is searching method? -
example index bar below image:
i want search word in array<string>
code searching method word?
example:
var = ["coffee","juice","water"]
searchword "co"
searching method's result "cofee",
first need iterate on array , select elements match condition, there's filter
method that. in case need check if word contains string, use containsstring
.
a.filter { $0.containsstring("un") }
Comments
Post a Comment