Removing an element from an Array (Java)

Tobias picture Tobias · Mar 13, 2009 · Viewed 893.6k times · Source

Is there any fast (and nice looking) way to remove an element from an array in Java?

Answer

Peter Lawrey picture Peter Lawrey · Mar 13, 2009

You could use commons lang's ArrayUtils.

array = ArrayUtils.removeElement(array, element)

commons.apache.org library:Javadocs