sequenceOf

fun <T> sequenceOf(vararg elements: T): Sequence<T>(source)

Creates a sequence that returns the specified values.

Since Kotlin

1.1

Samples

import kotlin.test.*

fun main() { 
   //sampleStart 
   val sequence = sequenceOf("first", "second", "last")
sequence.forEach(::println) 
   //sampleEnd
}
fun <T> sequenceOf(vararg elements: T): Sequence<T>(source)

Creates a sequence that returns the specified values.

Since Kotlin

1.0

Samples

import kotlin.test.*

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