1

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.

abhi.shah88
  • 193
  • 1
  • 9

2 Answers2

8

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.

Pablo Santa Cruz
  • 176,835
  • 32
  • 241
  • 292
1

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

Tozar
  • 976
  • 9
  • 20