Hi i have a nsmutable array full of keywords and i wish to key each object and spit it out with a comma after each object example below. The NSMutable array is called KeywordArray
Array Structure
Keyword 1
Keyword 2
Keyword 3
Keyword 4
Keyword 5
Keyword 6
Keyword 7
I wish to convert that NSMutableArray into the following format within a NSString
Keyword 1, Keyword 2, Keyword 3, Keyword 4, Keyword 5, Keyword 6, Keyword 7
Thanks
Mason
You can use the
componentsJoinedByString:method of NSArray to join the elements in the array using a separator. This will work with an NSMutableArray as well, because NSMutableArray inherits from NSArray.See the NSArray class reference for more information.