How to split array from specific index swift 3? -


this question has answer here:

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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -