associateTo

Common
JVM
JS
Native
1.0
inline fun <K, V, M : MutableMap<in K, in V>> CharSequence.associateTo(
    destination: M,
    transform: (Char) -> Pair<K, V>
): M

Populates and returns the destination mutable map with key-value pairs provided by transform function applied to each character of the given char sequence.

If any of two pairs would have the same key the last one gets added to the map.