Answers for "kotlin sequence builder"

0

kotlin sequence builder

val childNumbers = sequence {
 yield(1)
 print("AAA")
 yieldAll(listOf(2, 3))
}
childNumbers.forEach { print(it) } // 1AAA23
val nums = childNumbers.joinToString() // AAA
print(nums) // 1, 2, 3
Posted by: Guest on January-15-2021

Browse Popular Code Answers by Language