Add flatMap sample KT-20357
This commit is contained in:
committed by
Ilya Gorbunov
parent
29b25e3901
commit
664d69b752
@@ -749,6 +749,8 @@ public fun CharSequence.toSet(): Set<Char> {
|
||||
|
||||
/**
|
||||
* Returns a single list of all elements yielded from results of [transform] function being invoked on each character of original char sequence.
|
||||
*
|
||||
* @sample samples.collections.Collections.Transformations.flatMap
|
||||
*/
|
||||
public inline fun <R> CharSequence.flatMap(transform: (Char) -> Iterable<R>): List<R> {
|
||||
return flatMapTo(ArrayList<R>(), transform)
|
||||
|
||||
Reference in New Issue
Block a user