1

我该如何解决这个问题?

NSString * vendorName=@"can't event";
vendorName= [[[vendorName stringByReplacingOccurrencesOfString:@" " withString:@"%20"]    stringByReplacingOccurrencesOfString:@"'" withString:@"\\\'"] capitalizedString];

我收到的输出是Can\'T 事件

但是,我需要结果为Can\'t Event

谢谢

4

1 回答 1

4
NSString *vendorName=@"can't event";
vendorName= [[[vendorName capitalizedString] stringByReplacingOccurrencesOfString:@" " withString:@"%20"] stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"];
于 2013-02-12T16:55:08.597 回答