开发者

How to compare Chinese strings in English environment?

开发者 https://www.devze.com 2023-03-22 09:06 出处:网络
I\'m trying to compare Chinese strings with NSString - (NSComparisonResult)localizedS开发者_如何学运维tandardCompare:(NSString *)string method.

I'm trying to compare Chinese strings with NSString - (NSComparisonResult)localizedS开发者_如何学运维tandardCompare:(NSString *)string method.

It works correctly if the system language is set to Chinese. But in English language environment, the strings is compared by something like unicode number. How can I compare strings with Chinese style in English environment?


Use - (NSComparisonResult)compare:(NSString *)aString options:(NSStringCompareOptions)mask range:(NSRange)range locale:(id)locale instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消