addNewItems

inline fun <T> MutableList<T>.addNewItems(items: Iterable<T>): MutableList<T>

Add only new items to MutableList.

Example:

val list = mutableListOf(1..5)
list.addNewItems(3..8) // [1, 2, 3, 4, 5, 6, 7, 8]

Since

1.1.0

See also


inline fun <T> ArrayList<T>.addNewItems(items: Iterable<T>): ArrayList<T>

Add only new items to ArrayList.

Example:

val list = arrayListOf(1..5)
list.addNewItems(3..8) // [1, 2, 3, 4, 5, 6, 7, 8]

Since

1.1.0

See also