Here you can find the source of slice(String[] o, int index)
Parameter | Description |
---|---|
o | The original String[] to slice |
index | The index at which to slice |
public static String[] slice(String[] o, int index)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w . j a v a2s.c om*/ * Slices an array at the given index. * * @author l3eta * @param o * The original {@code String[]} to slice * @param index * The index at which to slice * @return The new, processed {@code String[]} */ public static String[] slice(String[] o, int index) { String[] result = new String[o.length - index]; for (int i = index; i < o.length; i++) { result[i - index] = o[i]; } return result; } }