从NSString中删除双引号

chr*_*o16 4 objective-c nsstring

如何从NSString中删除双引号.例:

//theMutableString: "Hello World"

[theMutableString replaceOccurrencesOfString:@"\"" withString:@"" options:NSCaseInsensitiveSearch range:(NSRange){0,[theMutableString length]}]
Run Code Online (Sandbox Code Playgroud)

它似乎没有用,也许因为我不得不逃避"在replaceOccurrencesOfString?

mip*_*adi 17

使用NSMakeRange函数而不是您的演员.这个工作:

[mString replaceOccurrencesOfString:@"\"" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [mString length])];
Run Code Online (Sandbox Code Playgroud)