I have
List<String> firstName = new ArrayList<String>()
and
List<String> lastName = ArrayList<String>()
Both holds the same 10 elements in the form of "Foo" + " " + "Bar."
My question is how do I remove “Foo” from each element in lastName and “Bar” from each element in firstName?
Alternatively like this and avoid having to deal with list indexes which can be prompt to performance issues in certain kind of list implementations which do not guarantee random access (i.e. LinkedList)