Pav*_*nen 0 string xcode replace space ios
可能重复:
如何在Xcode中用+替换空格
在这个字符串中我需要替换空格:
controller.body = [NSString stringWithFormat:@"http://maps.google.com/maps?q=%@@%@,%@", pinTitle.text, newlatLabel.text, newlogLabel.text];
Run Code Online (Sandbox Code Playgroud)
Rui*_*res 12
喜欢:
NSString *finalString = [controller.body stringByReplacingOccurrencesOfString:@" " withString: @"+"];
Run Code Online (Sandbox Code Playgroud)
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;
Run Code Online (Sandbox Code Playgroud)