您可以使用range(of:, options:)
选项进行变音符号不敏感(以及可选的不区分大小写)搜索.例:
let list = ["holesovice", "holešovice"] let searchTerm = "sovi" let filtered = list.filter { $0.range(of: searchTerm, options: [.diacriticInsensitive, .caseInsensitive]) != nil } print(filtered) // ["holesovice", "holešovice"]