The equivalent of Javas String.charAt() in Kotlin is String.get(). Since this is implemented as an operator, you can use [index]
instead of get(index)
. For example
val firstChar: Char = "foo"[0]
or if you prefer
val someString: String = "bar"
val firstChar: Char = someString.get(0)