2
我想遍歷數組字符串,並將其以下列方式添加到NSString
:Objective-C的 - 通過管道分離連接字符串
NSMutableArray *emailsArray = [[NSMutableArray alloc] initWithObjects:@"One", @"Two", @"Three", nil];
for (id email in emailsArray {
NSString *emails = ??;
}
因此,最終NSString
應該是以下幾點:
NSString *emails = @"One|Two|Three";
你能給我一個實際的代碼示例如何正確地做到這一點? – fuzz 2011-03-07 14:11:27
@Fulvio用代碼示例編輯了我的答案。 – Jilouc 2011-03-07 14:16:19
http://www.idev101.com/code/Objective-C/Strings/join.html – slf 2011-03-07 14:17:03