Replace occurrences of NSString - iPhone

前端 未结 2 1064
醉话见心
醉话见心 2020-12-28 13:55

I have a long NSString in which I m trying to replace special characters. Part of my string looks like this:

\"veau (c\\u00f4telette)\",\"veau (filet)\",\"ag         


        
2条回答
  •  隐瞒了意图╮
    2020-12-28 14:52

    The backslash is an escape character, so if you want to specify the actual backslash character in a string literal, you need to use two backslashes.

    NSString *new = [old stringByReplacingOccurrencesOfString: @"\\u0153" withString:@"oe"];
    

提交回复
热议问题