-1

I do not see where kotlin-stdlib/kotlin/String/get indicates whether it is 0 or 1 based, target or implementation defined. Where is this documented?

CW Holeman II
  • 4,661
  • 7
  • 41
  • 72

1 Answers1

1

It is 0-based.

For example:

val str = "Hello Kotlin Strings"
println(str.get(4)) //prints o
Collin Barrett
  • 2,441
  • 5
  • 32
  • 53
Ck Douglas
  • 11
  • 4