Here you can find the source of removeFromArray(String[] oldArray, String stringToRemove)
public static String[] removeFromArray(String[] oldArray, String stringToRemove)
//package com.java2s; /*L//from w w w .ja v a 2 s. c o m * Copyright SAIC * Copyright SAIC-Frederick * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/cananolab/LICENSE.txt for details. */ import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { public static String[] removeFromArray(String[] oldArray, String stringToRemove) { List<String> list = new ArrayList<String>(Arrays.asList(oldArray)); list.remove(stringToRemove); return list.toArray(new String[0]); } }