can someone tell me how i can remove an item from an array? say i have an array of 25 items. I want to remove item 20 from the array. now i have 24 items in the array. I want to remove an item but keep the other items in the array.
There are several ways to do it. But first question: does the order matter? You only said you wanted to keep the others in the array, you didn't say you wanted to keep the order. If order don't matter, you can just replace item 20 with item 24 (assuming you start numbering from zero...), then erase item 24. If order matters, you need to move item 21 to 24 into items 20 to 23.
In a REAL database program, you might want to use an index to keep track of the proper order of the items in the array, then simply put the last item in the array into any deleted items. "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.