0

Is possible to convert Array to Set to use contains syntax(for string) in SWIFT ?

For example I have: array1 = [1, 2, 4, 6] array2= [11,2, 45, 100 , 999] I want to quit duplicates :)

12th Mar 2019, 3:50 PM
Gramisteanu Adrian
Gramisteanu Adrian - avatar
1 Resposta
0
Assuming it is removing duplicates across the two arrays? Try var s = Set(array1) s = s.union(array2)
18th Mar 2019, 6:48 AM
Jenine