Remove accent from string


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.