iOS获取汉字首字母

#import "pinyin.h"   


    NSString *hanyu = @"程序员";

    for (int i = 0; i < [hanyu length]; i++)

     {

        printf("%c", pinyinFirstLetter([hanyu characterAtIndex:i]));

    }

类库下载 pinyin.zip

你可能感兴趣的:(iOS获取汉字首字母)