1. 程式人生 > >iOS字串轉陣列,陣列轉字串

iOS字串轉陣列,陣列轉字串

    NSArray *arrays = @[@"1,2,3,4,5,6"];

    NSString *string = [arrays componentsJoinedByString:@","];

NSArray *array = [string componentsSeparatedByString:@","];

NSLog(@"=string=--- %@",string);

NSLog(@"=array=--- %@",array);