Character Access in Kotlin

Level 120 keystrokes

Accesses and prints the first character of the string.

Kotlin code

// [index] returns the Char at that position
// Indexes start at 0, so [0] is the first character: K
1println("Kotlin"[0])

Output

K
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this Kotlin code and how often they appear.

  • "× 2
  • (× 1
  • )× 1
  • [× 1
  • ]× 1

More Kotlin examples at level 1

← Kotlin typing practice