iPhone Development 101

iPhone 101

Code Tips

Resources

Links

Follow

TwitterRSSE-mail

More

iPhone Development 101: Objective-C: Strings:
Joining an Array of Strings

Join an array of strings into a single string by using NSArray's componentsJoinedByString:


NSArray *words = [NSArray arrayWithObjects:@"This", @"is", @"a", @"test", nil];
NSString *sentence = [words componentsJoinedByString:@" "];

// sentence is now: @"This is a test"

More String Functions

Additional References


TopHome