Skip to content

//处理汉语拼音的首字母,并排序, 处理汉语全拼

License

Notifications You must be signed in to change notification settings

youran1024/HTChineseHandle

Repository files navigation

HTChineseHandle

License MIT Badge w/ Version Badge w/ Platform

Instruction

汉字拼音的处理方法,在一些需要提取汉字拼音首字母,或者通过汉字拼音首字母进行分类并排序的项目里,是非常有用的,希望大家喜欢~

Installation

pod 'HTChineseLetter`

Method Instruction

  • @interface NSString (FirstLetter)
//  获取第一个汉字拼音首字母
- (NSString *)firstLetter;

//  获取所有汉字拼音首字母
- (NSString *)firstLetters;

  • @interface NSArray (FirstLetterArray)

//	如果给定的数组对象里边都是字符串则调用此方法
- (NSDictionary *)sortedArrayUsingFirstLetter;

//	如果给定的数组里边是Model,或者字典则用这个,并且给出KeyPath
- (NSDictionary *)sortedArrayUsingFirstLetterByKeypath:(NSString *)keyPath;

Thanks

感谢提供pinyin文件的却未曾相识的George同志~

write the code, enjoy the world

Power by Mr.Yang

About

//处理汉语拼音的首字母,并排序, 处理汉语全拼

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published