public static < T > T [ ] remove ( T [ ] src , T object ) { int index = indexOf ( src , object ) ; if ( index == - 1 ) { return src ; } T [ ] dst = ( T [ ] ) Array . newInstance ( src . getClass ( ) . getComponentType ( ) , src . length - 1 ) ; System . arraycopy ( src , 0 , dst , 0 , index ) ; if ( index < src . length - 1 ) { System . arraycopy ( src , index + 1 , dst , index , src . length - index - 1 ) ; } return dst ; }
Removes an item from the array .