Here you can find the source of shiftArgs(final String[] args)
Parameter | Description |
---|---|
args | array of strings |
public static String[] shiftArgs(final String[] args)
//package com.java2s; //License from project: Apache License import java.util.Arrays; public class Main { /**//from ww w . j a v a 2 s .com * Shifts an array of strings by one item to the left. * @param args array of strings * @return the current array shifted by one item or an empty array * if there are no items to shift. */ public static String[] shiftArgs(final String[] args) { return shiftArgs(args, 1); } /** * Shifts an array of strings by the specified number of items to * the left. * @param args array of strings * @return the current array shifted by the specified number of * items or an empty array if there aren't enough items * to shift. */ public static String[] shiftArgs(final String[] args, final int count) { if (count > args.length) { return new String[] {}; } return Arrays.copyOfRange(args, count, args.length); } }