← Docs
kotlin-stdlib / kotlin.text / getOrElse

getOrElse

Common
JVM
JS
Native
1.0
inline fun CharSequence . getOrElse (
index : Int ,
defaultValue : ( Int ) -> Char
) : Char

(source)

Returns a character at the given index or the result of calling the defaultValue function if the index is out of bounds of this char sequence.

Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Supported and developed by JetBrains .
Kotlin™ is protected under the Kotlin Foundation
and licensed under the Apache 2 license .