2016-03-04 本文已影响102人
傲骨天成科技
//NSMutableString *ms=@"老王";
//将汉字转换为拼音
CFStringTransform((__bridge CFMutableStringRef)ms, 0, kCFStringTransformToLatin, NO);
//将拼音的声调去掉
CFStringTransform((__bridge CFMutableStringRef)ms, 0, kCFStringTransformStripDiacritics, NO);
//将字符串所有的字母大写
NSString *upStr=[ms uppercaseString];
//截取首字符
NSString *firstStr=[upStr substringToIndex:1];