标签:
- (NSString *)getPinYinFrom:(NSString *)chinese { CFMutableStringRef string = CFStringCreateMutableCopy(NULL, 0, (__bridge CFMutableStringRef)[NSMutableString stringWithString:chinese]); CFStringTransform(string, NULL, kCFStringTransformMandarinLatin, NO); CFStringTransform(string, NULL, kCFStringTransformStripDiacritics, NO); NSMutableString *aNSString = (__bridge NSMutableString *)string; NSString *finalString = [aNSString stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"%c", 32] withString:@""]; NSLog(@"%@", finalString); return finalString; }
标签:
原文地址:http://www.cnblogs.com/fs-ios/p/5045137.html