And if you aren't afraid of Perl you can:
my $replace = 0; for my $x (0 .. $#array) { next unless # pass of your condition; $array[$replace++] = $array[$x]; }
or maybe even:
your condition and $array[$replace++] = $array[$_] for 0 .. $#array;
In reply to Re^2: Efficient array element deletion
by GrandFather
in thread Efficient array element deletion
by kennethk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |