W3cubDocs

/Kotlin

sequenceOf

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun <T> sequenceOf(vararg elements: T): Sequence<T>

Creates a sequence that returns the specified values.

import kotlin.test.*

fun main(args: Array<String>) {
//sampleStart
val sequence = sequenceOf("first", "second", "last")
sequence.forEach(::println)
//sampleEnd
}

© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/sequence-of.html