Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Empty mutable array

How do i empty my mutable array ?

Thanks

Mason Soiza (web design derby)

like image 202
user393273 Avatar asked Dec 07 '10 11:12

user393273


People also ask

How do you create an empty mutable list?

To create an empty Set in Kotlin, call setOf() function with no values passed to it. setOf() function creates an immutable Set with the values provided, if any. To create an empty mutable set, call mutableSetOf() function with no values passed to it.

How do you clear Kotlin mutable list?

To remove all elements from a Mutable List in Kotlin, call clear() function on this list object.

How do I make a list empty in Kotlin?

Kotlin ArrayList class can be used in order to create an empty arrayList. It would be a dynamic array which means it will automatically expand as we add data into it. An ArrayList is an ordered sequence of elements, however, unlike simple arrays, an ArrayList can contain data of multiple data types.


1 Answers

[yourArray removeAllObjects];
like image 189
Björn Marschollek Avatar answered Oct 06 '22 09:10

Björn Marschollek