In Swift 3, I want to create an array of matching string (case insensitive) from string array:-
I am using this code, but it is case sensitive,
let filteredArray = self.arrCountry.filter { $0.contains("india") }
how can I do this.. suppose I have a master string array called arrCountry, I want to create other array of all the string who has "india"(case insensitive) in it.
Can anyone help me out.
The easiest way might be to lowercase your strings and compare:
Swift 3 and above
It's better to use
You can try with
localizedCaseInsensitiveContains