开发者

Joining all the elements in an NSMutableArray to form an NSString

I have an NSMutableArray of NSString objects. How would I make an NSString that consists of all the elements in that array joined together with semicolons in between?

For example:

array = "hello","hi","bye",nil;
output = "hello开发者_StackOverflow中文版;hi;bye";


NSMutableArray *array = [NSMutableArray arrayWithObjects:@"hello", @"hi", @"bye", nil];
NSString *output = [array componentsJoinedByString:@";"];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜