Hi i have this array say
name[0] = hello
name[1] = bye
name[2] = ok
name[3] = wassup
and so on....
i want to pop the elements from the index 2 to the end of the array because i want to replace them with new ones.I am running a loop so cant keep track of the individual indices but would be able to keep track of the element 2.So how could i pop the elements from 2 onwards to the rest till the array is defines ?
i was using
delete array[2,..]
is this valid?
This is what the splice function is for; just do
splice @array, 2;.