associateWithTo

Common
JVM
JS
Native
1.3
inline fun <V, M : MutableMap<in Char, in V>> CharSequence.associateWithTo(
    destination: M,
    valueSelector: (Char) -> V
): M

Populates and returns the destination mutable map with key-value pairs for each character of the given char sequence, where key is the character itself and value is provided by the valueSelector function applied to that key.

If any two characters are equal, the last one overwrites the former value in the map.