Java: Slice Array To End
java
Solution
String[] arr = {"One", "Two", "Three", "Four", "Five"};
String[] arr2 = Arrays.copyOfRange(arr, 2, arr.length);
//Note third param is exclusive
Problem
I have a string array with at least three elements. I'd like to copy the third and all subsequent elements into a new array. How can this be most efficiently achieved?