← Unit 1 · all exercises
Saved in this browser only

First letter

Return just the first character of the word, as a String.

String first(String word)

Solution.java
Loading editor…
Results

Examples

  • first(Java) → J
  • first(hello) → h

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