Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun CharSequence.getOrNull(index: Int): Char?
Returns a character at the given index or null
if the index is out of bounds of this char sequence.
import kotlin.test.*
fun main(args: Array<String>) {
val list = listOf(1, 2, 3)
println(list.getOrNull(0))
println(list.getOrNull(2))
println(list.getOrNull(3))
val emptyList = emptyList<Int>()
println(emptyList.getOrNull(0))
}