Here you can find the source of copyArrayCutFirst(String[] arr)
Parameter | Description |
---|---|
arr | Original array of strings |
public static String[] copyArrayCutFirst(String[] arr)
//package com.java2s; //License from project: Apache License public class Main { /**/*from ww w . j av a 2 s . c o m*/ * Utility function that copies a string array except for the first element * * @param arr Original array of strings * @return Copied array of strings */ public static String[] copyArrayCutFirst(String[] arr) { if (arr.length > 1) { String[] arrCopy = new String[arr.length - 1]; System.arraycopy(arr, 1, arrCopy, 0, arrCopy.length); return arrCopy; } else { return new String[0]; } } }