map Values
fun <TValueOut> mapValues(transformFn: (TValue) -> TValueOut): SortedKeyValueSequence<TKey, TValueOut>
Returns a new sequence with transformed values while preserving keys and sort order.
Example:
val sequence = sequenceOf(1 to "a", 2 to "b").assertSorted()
val upperCase = sequence.mapValues { it.uppercase() }
assertEquals(listOf(1 to "A", 2 to "B"), upperCase.toList())
Content copied to clipboard
Return
A new sorted sequence with transformed values
Parameters
transform Fn
The function to transform each value