开发者

Is there any "Built in function to Concatenate the whole NSMutableArray NSString items"?

is开发者_开发问答 there any built in function to Concatenate the whole NSMutableArray NSString items

i have an NSMutableArray with 4 elements in the following structure

myArray[0] = "HI";
myArray[1] = "WELCOME";
myArray[2] = "TO";
myArray[3] = "STACKOVERFLOW";

I need to get the sentence "HI WELCOME TO STACKOVERFLOW" from my NSMutableArray(myArray) .

may i know , any built in functions to do it?

Thanks

NB:Without iterating the array through any loop


Yes, there's function you need:

 NSString *result = [myArray componentsJoinedByString:@" "];


Yes:

[NSArray componentsJoinedByString:@" "]


Simply do NSString *myString = [myArray componentsJoinedByString:@" "];

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜