When performing string searches, we often write the following:
$0.name.lowercased().contains(searchPhrase.lowercased())
Instead, we can:
$0.name.localizedStandardContains(searchPhrase)
Why is this better?
More Readable, Localization-Friendly, Built-In Case Insensitivity
When performing string searches, we often write the following:
$0.name.lowercased().contains(searchPhrase.lowercased())
Instead, we can:
$0.name.localizedStandardContains(searchPhrase)
Why is this better?
More Readable, Localization-Friendly, Built-In Case Insensitivity