Posted By

rabc on 04/13/11


Tagged

accent diacritic


Versions (?)

Remove accent from string


 / Published in: Objective C
 

  1. -(NSString*)stringWithoutAccentsFromString:(NSString*)s
  2. {
  3. if (!s) return nil;
  4. NSMutableString *result = [NSMutableString stringWithString:s];
  5. CFStringFold((CFMutableStringRef)result, kCFCompareDiacriticInsensitive, NULL);
  6. return result;
  7. }

Report this snippet  

You need to login to post a comment.