Let's say I have an array:
int[] values = {1, 2, 3, 4, 5, 6, 7 , 8, 9, 0};
With two indexes (let's say 2 and 5), I want to be able to return array from indexes 2 to 5 from the variable values given above. The final output should be this:
newValues[] = {3, 4, 5, 6};
Also, how would this procedure be used with multi dimensional arrays?
I would have googled this, but I'm not sure what to google, so I came here.
Arrays.copyOfRange(original, from, to)toindex is excluded in result array so you will have to correct it with +1.