iOS中数组拼接方法

eg: 如果一个数组是1,2,3,7
一个数组是1,2,3,4,5,6
怎么拼接成数组1,2,3,4,5,6,7

NSArray *array1 = @[@"1",@"2",@"3"];
NSArray *array2 = @[@"1",@"5",@"6"]; 
NSMutableSet *set1 = [NSMutableSet setWithArray:array1];
NSMutableSet *set2 = [NSMutableSet setWithArray:array2]; 

[set1 unionSet:set2];       //取并集后 set1中为1,2,3,5,6
[set1 intersectSet:set2];  //取交集后 set1中为1
[set1 minusSet:set2];
©️2020 CSDN 皮肤主题: 游动-白 设计师:上身试试 返回首页