字符串拼接

NSMutableString *groupName = [[NSMutableString alloc]init];
    for (int i = 0; i< addedFriendArray.count; i++) {
         (i==0)?:[groupName appendString:@","];
        NSString *name = [[addedFriendArray objectAtIndex:i] name];
        [groupName appendString:name];
    }
    NSLog(@"groupName is%@",groupName);

 

posted @ 2014-01-20 10:29  菜鸟程序猿  阅读(130)  评论(0编辑  收藏  举报