Here you can find the source of removeMember(String[] list, String id)
Parameter | Description |
---|---|
list | The current array |
id | The id to remove |
public static String[] removeMember(String[] list, String id)
//package com.java2s; /**// w w w . j a va 2s . c om * The contents of this file are subject to the license and copyright * detailed in the LICENSE and NOTICE files at the root of the source * tree and available online at * * http://www.dspace.org/license/ */ import java.util.*; public class Main { /** * Remove all instances of the given id from the member list. * * @param list The current array * @param id The id to remove * @return A new combined array. */ public static String[] removeMember(String[] list, String id) { // FIXME: this is terribly inefficient. List<String> newList = new ArrayList<String>(Arrays.asList(list)); newList.remove(id); return newList.toArray(new String[newList.size()]); } }