如果要移除NSStringni'hao shi'jie
中的單引號,那麼可以使用這條語句:
NSString *stringWithoutQuotation = [myString
stringByReplacingOccurrencesOfString:@"'" withString:@""];
也可以使用這條語句:
NSString* noQuotation =
[[myString componentsSeparatedByCharactersInSet:@"'"]
componentsJoinedByString:@""];