removing elements from an array
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   aama_aama
Posted On:   Wednesday, October 2, 2002 01:59 AM

how can i remove some element from an array

Re: removing elements from an array

Posted By:   Sandeep_Shilawat  
Posted On:   Monday, November 11, 2002 11:33 AM

A wrok arround.


Create a Set from array. Then remove from the Set and then call Set.toArray()

very expensive though !

Re: removing elements from an array

Posted By:   Lasse_Koskela  
Posted On:   Wednesday, October 2, 2002 02:04 AM

Basically you can't.


But you can emulate that behaviour by

a) creating a new array and copying the "remaining" stuff there

b) moving the subsequent items one slot upwards in the existing array


You could also just set the cell to null and treat it as a "removed cell".

About | Sitemap | Contact