忽略 nsarray 中的一系列项目
我有一个未知项目的 NSArray
。我知道总会有超过 10 个项目。
我想将除前 10 个项目之外的所有项目分配给 NSString
。
比如:
NSString *itemString = (NSString*)[itemArray StartingIndex:10];
是否有一种简单有效的方法无需迭代即可完成此任务?
谢谢!
I have an NSArray
of unknown items. I know there will always be more than 10 items.
I would like to assign all but the first 10 items to an NSString
.
Something like:
NSString *itemString = (NSString*)[itemArray StartingIndex:10];
Is there a simple efficient way without iteration to accomplish this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该数组很可能会为您进行迭代,但您可以这样做:
您的意思可能是您想要将数组中除前十项之外的每个项目连接到单个字符串中。在这种情况下,您将必须执行自己的迭代来执行串联。
The array is most likely iterating for you, but you can do this:
It's possible what you mean is that you want to concatenate every item in the array except the first ten into a single string. In that case, you are going to have to do your own iteration to perform the concatenation.