Possible Duplicate:
How do i replace spaces with +'s in Xcode
In this string I need to replace spaces:
controller.body = [NSString stringWithFormat:@"http://maps.google.com/maps?q=%@@%@,%@", pinTitle.text, newlatLabel.text, newlogLabel.text];
Possible Duplicate:
How do i replace spaces with +'s in Xcode
In this string I need to replace spaces:
controller.body = [NSString stringWithFormat:@"http://maps.google.com/maps?q=%@@%@,%@", pinTitle.text, newlatLabel.text, newlogLabel.text];
Like:
NSString *finalString = [controller.body stringByReplacingOccurrencesOfString:@" " withString: @"+"];
controller.body = [NSString stringWithFormat:@"http://maps.google.com/maps?q=%@@%@,%@", pinTitle.text, newlatLabel.text, newlogLabel.text];
NSString *finalString = [controller.body stringByReplacingOccurrencesOfString:@" " withString: @"+"];
controller.body = finalString;
Think you are looking for this:
NSString *finalString = [controller.body stringByReplacingOccurrencesOfString:@" " withString:@"+"];