Answers for "kotlin array add to list"

2

kotlin add element to array

val list: MutableList<String> = ArrayList()
list.add(3, "Hello")
// Adds Hello as the third item in list

list.add("Goodbye")
// Adds Goodbye to the end of list
Posted by: Guest on May-23-2020
0

Kotlin add item to List

itemsList.toMutableList().add(item)
Posted by: Guest on October-31-2021

Browse Popular Code Answers by Language