Here you can find the source of subarray(String[] args, String sep)
public static String[] subarray(String[] args, String sep)
//package com.java2s; //License from project: Open Source License public class Main { public static String[] subarray(String[] args, String sep) { int i = 0; while (i < args.length && !args[i].equals("--")) { i++;// w w w.j ava2 s. c om } return copy(args, 0, i); } public static String[] copy(String[] array, int offset, int length) { assert (array.length >= offset + length); String[] aa = new String[length]; System.arraycopy(array, offset, aa, 0, length); return aa; } }