Collection swap
I have a basic question in collection. I know there is a swap function in Collections, but is there one for Collection ?Collection coll1 contains "b", "a" and "c" in that order. I want to swap "a" and "b".
Thanks for your reply, but I cannot use collections, since I am getting this Collection object through an API. Is there a simple way to swap ? Or do I need to search for the object, note the index and swap that way ?
I don't quite understand why you couldn't use the Collections class, but none the less, if you cannot, then yes, I would do a simple swap by getting the two indexes of the items to swap and then manually swap them.