Add sample for reduceOrNull and reduceRightOrNull
This commit is contained in:
committed by
Ilya Gorbunov
parent
06008c40ab
commit
9546307243
@@ -1197,6 +1197,8 @@ public inline fun CharSequence.reduceIndexed(operation: (index: Int, acc: Char,
|
||||
|
||||
/**
|
||||
* Accumulates value starting with the first character and applying [operation] from left to right to current accumulator value and each character. Returns null if the char sequence is empty.
|
||||
*
|
||||
* @sample samples.collections.Collections.Aggregates.reduceOrNull
|
||||
*/
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalStdlibApi
|
||||
@@ -1242,6 +1244,8 @@ public inline fun CharSequence.reduceRightIndexed(operation: (index: Int, Char,
|
||||
|
||||
/**
|
||||
* Accumulates value starting with last character and applying [operation] from right to left to each character and current accumulator value. Returns null if the char sequence is empty.
|
||||
*
|
||||
* @sample samples.collections.Collections.Aggregates.reduceRightOrNull
|
||||
*/
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalStdlibApi
|
||||
|
||||
Reference in New Issue
Block a user