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.

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.