How to convert List to ArrayList

I know this is basic but I can't find any shortcut to do this other than building a new arraylist and inserting them.

collection.map{ x -> x.title). ?

3 Likes

ArrayList(whatever_collection)

20 Likes

use collection.toMutableList() extension function.

Actually toMutableList is not guaranteed to provide an arraylist.

1 Like