How can I combine multiple collections into a sin...
# getting-started
h
How can I combine multiple collections into a single logical collection in Kotlin? Some solutions depending mostly on guava
Iterables.concat(Iterable<T> ...)
are described in http://stackoverflow.com/questions/4896662/combine-multiple-collections-into-a-single-logical-collection but I was wondering if there's already something in kotlin-stdlib? For sure I know about
Copy code
val anotherEl = 3
listOf(1,2,3).plus(anotherEl)
but this will create another ArrayList to just add the new element. I was more hoping to wrap the second additional element into a list and to concatenate the list slogically.