refreshList

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

Clear the MutableList and the add new items.

Example:

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

Since

1.1.0

See also


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

Clear the ArrayList and the add new items.

Example:

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

Since

1.1.0

See also