v1.7.0
  • Solutions
    • Multiplatform Mobile
    • Multiplatform for other platforms
    • Server-side
    • Web frontend
    • Data science
    • Android
  • Docs
  • Community
  • Teach
  • Play
    • Playground
    • Hands-on
    • Examples
    • Koans
← Docs
kotlin-stdlib / kotlin / String / get

get

Common
JVM
JS
Native
1.0
fun get(index: Int): Char
(Common source) (Native source)
For Common, JVM, JS

Returns the character of this string at the specified index.

If the index is out of bounds of this string, throws an IndexOutOfBoundsException except in Kotlin/JS where the behavior is unspecified.

For Native

Returns the character of this string at the specified index.

If the index is out of bounds of this string, throws an IndexOutOfBoundsException.

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