in reply to Re (tilly) 6: How do I remove an element from any array while iterating over it in a loop?
in thread How do I remove an element from any array while iterating over it in a loop?
And furthermore the request was explicitly not a case of modifying elements, it was a straight filtering operation. Sorry, I missed that, typing replies while waiting on compiles. I thought he was doing a bunch of stuff with the element, and sometimes wanted to remove it as well. I guess he didn't need to be so complicated.
Given that, I agree: to delete items that match a test, grep for the inverse of that test.
—John
|
|---|