compare special characters like À with regular A

前端 未结 3 1310
北海茫月
北海茫月 2021-01-25 20:54

In some languages there are letters like À, I saw that for table view sections the native iOS put À under the same section as A.
I wan

3条回答
  •  后悔当初
    2021-01-25 21:34

    Don't convert or transform as per the other answers. First, try -[NSString localizedStandardCompare:]. If that doesn't do what you want, pass NSDiacriticInsensitiveSearch among the options to one of the NSString comparison methods (such as -compare:options:range:locale:). You may want to use additional options, too, such as NSCaseInsensitiveSearch.

提交回复
热议问题