Java Array Shift shift(String[] array)

Here you can find the source of shift(String[] array)

Description

shift

License

Apache License

Declaration

public static String[] shift(String[] array) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static String[] shift(String[] array) {
        return shift(array, 1);
    }/*from w  w w . j  a  v a 2  s .com*/

    public static String[] shift(String[] array, int n) {
        if (n <= 0) {
            throw new IllegalArgumentException("n must a non-negative number.");
        }

        if (n >= array.length) {
            return new String[0];
        }

        String[] dest = new String[array.length - n];
        System.arraycopy(array, n, dest, 0, array.length - n);
        return dest;
    }
}

Related

  1. Shift(int[] in, int amt, int spare)
  2. shift(int[] v, int n)
  3. shift(int[][] array, boolean inverse)
  4. shift(Object a[], int count)
  5. shift(String[] args, int count)
  6. shift(String[] in)
  7. shift(String[] original, int offset)
  8. shift(String[] src, String word)
  9. shift(String[] tokens)