Posted By

rabc on 04/13/11


Tagged

accent diacritic


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

dvel


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.