← Unit 1 · all exercises
Saved in this browser only

The middle letter

The word will always have exactly three letters. Return just the middle one, as a String.

String middle(String word)

Solution.java
Loading editor…
Results

Examples

  • middle(cat) → a
  • middle(dog) → o

There are also 3 hidden tests you can't see. Solve the problem, not the examples.