I try to test the following code under different Locale settings
let text = "total sdfs"
let text1 = "Total 张"
let text2 = "TOTAL لطيف"
let text3 = "total :"
let text4 = "ToTaL : "
text.lowercased().contains("total".lowercased())
text1.lowercased().contains("张".lowercased())
text2.lowercased().contains("لطيف".lowercased())
text3.lowercased().contains("total".lowercased())
text4.lowercased().contains("total".lowercased())
text.localizedCaseInsensitiveContains("total")
text1.localizedCaseInsensitiveContains("张")
text2.localizedCaseInsensitiveContains("لطيف")
text3.localizedCaseInsensitiveContains("total")
text4.localizedCaseInsensitiveContains("total")
However, all of them behave same under different system Locale settings.
I was wondering, is there any good example, where where String.lowercased().contains will behave differently than String.localizedCaseInsensitiveContains?
Or, those 2 code are just equivalent?