Objective C - 如何连接整个字符串数组?
我是 Objective C 新手。我想编写一个方法,它接受一个字符串数组并返回一个连接字符串,每个字符串之间有一个逗号 (,)。 所以如果一个数组是{abcd},我想返回a,b,c,d。
最简单的方法是什么?
I am an Objective C newbie. I want to write a method that takes in an array of strings and returns a concatenated string, with a comma (,) in between each string.
So if an array is {a b c d}, I want to return a,b,c,d.
What is the easiest way to do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
方法有很多种,最简单的就是
There are many ways to do it, the simplest being
使用 NSArray 的
componentsJoinedByString:
方法。Use NSArray's
componentsJoinedByString:
method.