1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
var array3 = [String](repeating: "Hello", count: 10)
var array4 = Array(repeating: 1, count: 10)
var array = [1,2,3,4,5,6,7,8,9]
array.append(contentsOf: [11,12,13])
array.insert(0, at: 0)
array.insert(contentsOf: [-2,-1], at: 0)
array.remove(at: 1)
array.removeSubrange(0...2)
array.replaceSubrange(0...2, with: [0,1])
for item in arrayLet.enumerated(){ print(item) } var arraySort = [1,3,5,6,7]
arraySort.max()
arraySort.min()
arraySort = arraySort.sorted(isOrderedBefore: >)
arraySort = arraySort.sorted(isOrderedBefore: <)
|