Remove double quotes from NSString

前端 未结 6 456
长情又很酷
长情又很酷 2020-12-18 08:28

How do I remove double quotes from an NSString. Example:

//theMutableString: \"Hello World\"

[theMutableString replaceOccurrencesOfString:@\"\\\"\" withStr         


        
6条回答
  •  隐瞒了意图╮
    2020-12-18 09:12

    Use the NSMakeRange function instead of your cast. This'll work:

    [mString replaceOccurrencesOfString:@"\"" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [mString length])];
    

提交回复
热议问题