The list of methods to do Array Slice are organized into topic(s).
byte[]
slice(byte[] source, int start, int end) slice
if (start < 0 || end > source.length) {
throw new IllegalArgumentException("start or end is out of bound");
byte[] target = new byte[end - start];
System.arraycopy(source, start, target, 0, target.length);
return target;
String[]
slice(String source[], int start, int end) slice
if (source == null)
return null;
if (start == end)
return new String[0];
int e = Math.max(start, end);
e = Math.min(e, source.length);
int s = Math.min(start, end);
String newArray[] = new String[e - s];
...
String[]
slice(String[] array, int a, int b) slice
String[] newarray = new String[b - a];
if (!(a < array.length && b <= array.length)) {
throw new Exception("out of bound:" + a + "," + b);
for (int i = a; i < b; i++) {
newarray[i - a] = array[i];
return newarray;
...
String[]
slice(String[] o, int index) Slices an array at the given index.
String[] result = new String[o.length - index];
for (int i = index; i < o.length; i++) {
result[i - index] = o[i];
return result;