NSString - Convert to pure alphabet only (i.e. remove accents+punctuation)

前端 未结 13 1437
暖寄归人
暖寄归人 2020-12-02 15:49

I\'m trying to compare names without any punctuation, spaces, accents etc. At the moment I am doing the following:

-(NSString*) prepareString:(NSString*)a {
         


        
13条回答
  •  一向
    一向 (楼主)
    2020-12-02 16:18

    NSString* finish = [[start componentsSeparatedByCharactersInSet:[[NSCharacterSet letterCharacterSet] invertedSet]] componentsJoinedByString:@""];
    

提交回复
热议问题