开发者

how to add different object form my nsarray to nsstring

I am having a mutable array which has differnt value at differert index such as at index 开发者_运维技巧 value 0 Hi 1 this 2 is 3 iphone 4 testing.

So at differnt index ,array has different string value now i want this into one string which has reads as Hi this is iphone testing.

Thanks.


You can use this:

NSArray *yourArray;
NSString *createdString = [yourArray componentsJoinedByString:@" "];

Separating array components with a space.

Here's documentation for NSArray. Here's documentation for message componentsJoinedByString.


You can append strings together with [NSString stringWithFormat:@"%@ %@ %@", string1,string2,string3];

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜