How to split array from specific index swift 3? -
this question has answer here:
- how copy end of array in swift? 4 answers
for example have array of let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
. want value index 5th last , rest want throw away. idea of this? thank in advance.
this looking for:
arr[5..<arr.count]
it print [6, 7, 8, 9, 10, 11, 12]
. adjust index accordingly if need start different index. make sure check arr
has more 5 elements.
if need array try array(arr[5..<arr.count])
Comments
Post a Comment