Reputation: 195
How can i solve the problem ?
NSString * vendorName=@"can't event";
vendorName= [[[vendorName stringByReplacingOccurrencesOfString:@" " withString:@"%20"] stringByReplacingOccurrencesOfString:@"'" withString:@"\\\'"] capitalizedString];
Output i am receiving is Can\'T Event
But, i need result as Can\'t Event
Thanks
Upvotes: 1
Views: 273
Reputation: 31091
NSString *vendorName=@"can't event";
vendorName= [[[vendorName capitalizedString] stringByReplacingOccurrencesOfString:@" " withString:@"%20"] stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"];
Upvotes: 4