开发者

How do i replace spaces with +'s in Xcode

开发者 https://www.devze.com 2023-04-02 05:14 出处:网络
I am build开发者_如何学JAVAing an app with a lot of urls being called from a MySQL server. What I need to do for my app is take the textfield text and send it (which i already know how to do) BUT i n

I am build开发者_如何学JAVAing an app with a lot of urls being called from a MySQL server.

What I need to do for my app is take the textfield text and send it (which i already know how to do) BUT i need to replace the spaces with + (pluses)


Try with the string method - (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement;

str=[str stringByReplacingOccurrencesOfString:@" " withString:@"+"];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号