
-----------------------------------
blackhawk_prince
Sun May 18, 2008 8:49 am

get  and index and remove it in an ArrayList
-----------------------------------
simple question, is there a method to get an index and remove it form an arraylist?

-----------------------------------
syntax_error
Sun May 18, 2008 10:05 am

RE:get  and index and remove it in an ArrayList
-----------------------------------
a.remove(i)

is that what you are looking for?

-----------------------------------
Reality Check
Sun May 18, 2008 3:13 pm

Re: get  and index and remove it in an ArrayList
-----------------------------------
Well what are you trying to get?  Is it a specific Integer Object or a String?  You can use the indexOf method to locate a specific word or number and then once you have gotten the index you can remove it.


a.add ("the");
a.add ("here");
a.add ("ka");
a.add ("array");

a.remove (a.indexOf ("here"));


This removes the "here" object from your list.  You should be using the java help for a simple question like this though...
