mutableSetOf

Returns an empty new MutableSet.

inline fun <T> mutableSetOf(): MutableSet<T>(source)
val fruits = mutableSetOf("apple", "banana", "cherry")

// Add a new element
fruits.add("date")

// Remove an element
fruits.remove("banana")

// Iterate over the set
for (fruit in fruits) {
    println(fruit)
}

Source