Java Array Sub Array subarray(String[] args, String sep)

Here you can find the source of subarray(String[] args, String sep)

Description

subarray

License

Open Source License

Declaration

public static String[] subarray(String[] args, String sep) 

Method Source Code

//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;
    }
}

Related

  1. subArray(Object a[], int from)
  2. subArray(Object in[], int start, int end)
  3. subArray(Object[] arr, int start, int length)
  4. subArray(Object[] data, int startIndex, int endIndex)
  5. subArray(String a[], int from)
  6. subArray(String[] array, int start, int endExclusive)
  7. subArray(String[] data, int index, int length)
  8. subarray(String[] master, int index)
  9. subArray(String[] strings, int nStart)